Alternative way of getting the Number of Controls Count using jQuery.

vishalneeraj-24503
Posted by vishalneeraj-24503 under jQuery category on | Points: 40 | Views : 1102
jQuery also has Size method through which we can find the number of controls too.
Suppose,we have following HTML structure as shown below:-
<div id = div_1" class = "class1">
<div id = div_2" class = "class2">container 1</div>
<div id = div_3" class = "class2">container 2</div>
</div>

$('.class1').size();
Output:- 1
$('.class2').size();
Output:- 2

Comments or Responses

Login to post response