function myFunction() {
var element = document.getElementsByClassName("mystyle");
element.classList.remove("mystyle");
}
myFunction();
<div class="mystyle"></div>
function delete_class_by_name(class_name)
{
let element = document.querySelector('.' + class_name);
if (element) element.classList.remove(class_name);
}
delete_class_by_name('mystyle');
function delete_all_class_by_name(class_name)
{
let elements = document.querySelectorAll('.' + class_name);
elements.forEach(function(element){
element.classList.remove(class_name);
});
}
delete_all_class_by_name('mystyle');