I need to count all elements who has id like ‘hi*’.
For example, if we have markup below:
<div id="hi1"></div>
<div id="hi2"></div>
Num value has to be ‘2’.
In the web I have found this:
var num = $('.insttip:regex(id,'+ id[0] + '*').length;
But this is not working 🙁
Thank you!
jsBin demo
try with:
The
^selector meansstarts with. Hope this helps