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.
This is a simpler approach:
$('.ui-state-active').length
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With