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

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

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -

asp.net - call stack missing info on mono with apache and mod_mono -