Lesson: jQuery
Remove Classes from an element with jQuery
In the same way you can add classes to an element with jQuery's addClass()
function, you can remove them with jQuery's removeClass()
function.
Here's how you would do this for a specific button:
$("#target2").removeClass("btn-default");
Let's remove the btn-default
class from all of our button
elements.
The content on this page is licensed under Attribution-ShareAlike 4.0 International. Original authors: freeCodeCamp, the content was modified.