'; var adpushup = adpushup || {}; adpushup.que = adpushup.que || []; adpushup.que.push(function() { adpushup.triggerAd(ad_id); });
To remove all classes, use the removeClass() method with no parameters. This will remove all of the item's classes.
Example
You can try to run the following code to remove all CSS classes using jQuery:
<html> <head> <title>jQuery Selector</title> <script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function() { $("#button1").click(function(){ $("p").removeClass(); }); }); </script> <style> .red { color:red; } .blue { color:blue; } </style> </head> <body> <p class = "red" >This is first paragraph.</p> <p class = "blue">This is second paragraph.</p> <button id="button1">Remove</button> </body></html>
Updated on: 06-Dec-2019
4K+ Views
Related Articles
- How to remove all CSS classes using jQuery?
- How to add and remove CSS classes to an element using jQuery?
- How to remove all style attributes using jQuery?
- How CSS classes can be manipulated in HTML using jQuery?
- How to Add and Remove multiple classes in jQuery?
- Pseudo-classes and all CSS Classes
- How to remove all child nodes from a parent using jQuery?
- How to remove global CSS file from a particular page using jQuery?
- How to remove all child nodes from a parent node using jQuery?
- How to remove all the attributes of an HTML element using jQuery?
- How to remove all the elements from DOM using element ID in jQuery?
- How to specify order of classes using CSS?
- How to remove disabled attribute using jQuery?
- How to remove event handlers using jQuery?
- How to change CSS using jQuery?
Advertisem*nts
';adpushup.triggerAd(ad_id); });