If you want to remove mutiple classes on click of a button:
HTML:
<div class="container">
<span class="class1 class2 class3"></span>
<button id="clear" type="button"></button>
</div>
JS:
$("#clear").click(function(){
$("span").removeClass("class2 class3")
});
To add mutiple classes:
$("#clear").click(function(){
$("span").addClass("class2 class3")
});
This is how you can add/remove multiple classes.
0 Comment(s)