addClass() removeClass()
If you have to add or remove multiple classes with jQuery, the most efficient way is to separate the classes with a space and make one call.
Such as:
$(…).addClass(’abc def’);
As opposed to:
$(…).addClass(’abc’).addClass(’def’);
Leave a comment
You must be logged in to post a comment.