javascript - jQuery count how many divs with a class there are and put into string -
is there way in jquery count how many divs have , put number string
<div class="name">some text</div> <div class="name">some other text</div> <div class="different">different text</div>
so count divs class name
, put string output this
var strnodivs = 2
any ideas?
thanks
jamie
var nb = $('div.name').length;
Comments
Post a Comment