How do I select all ids which are the integers.
for example
<div id="1"></div>
<div id="2"></div>
<div id="3"></div>
somdething [id^="integer"]
?
I know how to select ids that has similar name starting:
[id^="similar_"]
You can use filter()
. The equivalent of [id^=integer]
would be :
$('div').filter(function(){
return this.id.match(/^\d/);
})
Only integer would be :
$('div').filter(function(){
return this.id.match(/^\d+$/);
})
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