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

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -