Working with hasClass() attribute in jQuery?

Posted by vishalneeraj-24503 under jQuery category on | Points: 40 | Views : 680
.hasClass() attribute determines whether class is assigned to any particular control or not.It returns true if any class is applied otherwise returns false.
For Example:-
<div id = "div_employee" class="class1 class2"></div>

Above code will return true as div has applied 2 classes as class1 and class2 in it.

Above code will return false as there is no class3 class applied to div.

Comments or Responses

Login to post response