Are you first timer at Why not join us and start exchange your programming knowledge with everyone. Register today!

jQuery .addClass() and .removeClass() method

0 votes
added May 4, 2018 in jQuery by LC Marshal Captain (26,090 points)
//remove multiple classes
$ ('#element').removeClass('firstClass secondClass');

1 Response

0 votes
responded May 4, 2018 by LC Marshal Captain (26,090 points)
// add class to element if the body contains specific class
if($(body).hasClass('forum')) {
} - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.