I tried $(document).removeClass("myClassname")
but it doesn't seem to work.
To remove a class from an element, you use the remove() method of the classList property of the element.
To remove all CSS classes of an element, we use removeClass() method. The removeClass() method is used to remove one or more class names from the selected element.
To add the CSS classes to an element we use addClass() method, and to remove the CSS classes we use removeClass() method.
$(".myClassname").removeClass("myClassname")
$(".myClassname")
will match all elements that have the class myClassname
.
I think you are looking for this. It will select all the elements with class myClassname
and remove that class for those elements.
$('.myClassname').removeClass('myClassname');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With