Possible Duplicate:
jQuery Return elements where ID begins with a certain string
Ok, let's say I have the following elements:
<select id="state_id" value="20">test1</select>
<select id="state_id1" value="21">test2</select>
<select id="state_id2" value="22">test3</select>
How can I get the length()
of the select tags that the id begins with state_id
in this case?
I have tried: $("^#state_id").length();
but no success.
Any hint?
Try this...
$('[id^=state_]').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