Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove class from multiple elements in JavaScript or jQuery

Supposing I have this HTML with multiple elements and class.

How can I remove without naming the elements from all the element the class classToRemove ?

Thanks.


<html>
<body class="classToRemove">
    <div class="classToRemove">
        <a class="classToRemove">Link</a>
    <div>
</body>
<html>

1 Answers

with jQuery it's really easy $('.classToRemove').removeClass('classToRemove');

like image 67
Saar Avatar answered Jan 27 '26 03:01

Saar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!