check if css class exist and if yes how many times
css, dom, html, javascript, jquery
Solution
This is a simpler approach:
$('.ui-state-active').length
Problem
I'd like to know if a style `class` exists and if yes, how many elements have it. To know if a style `class` exists, I use: ``` if ($("*").hasClass('ui-state-active')) { alert("class exist : "+nb_checked); } ``` But to know how many elements have the class, I can't figure out.