How to Add multiple classes to any controls dynamically?

 Posted by vishalneeraj-24503 on 1/3/2015 | Category: jQuery Interview questions | Views: 2062 | Points: 40
Answer:

More than one class may be added at a time,separated by a space,to the set of matched elements like below code:-
<script src="//code.jquery.com/jquery-1.10.2.js"></script>

$("p").addClass("class1 class2");

Here class1 and class2 are 2 separate classes.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response