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

jQuery .addClass() and .removeClass() method

0 votes
27 views
added May 4 in jQuery by LC Marshal Lieutenant (13,450 points)
//remove multiple classes
$ ('#element').removeClass('firstClass secondClass');

1 Response

0 votes
responded May 4 by LC Marshal Lieutenant (13,450 points)
// add class to element if the body contains specific class
if($(body).hasClass('forum')) {
 $('.forum-question').addClass('forum-question-style');
}
lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...