Iterate over all identifiers starting with XXX

Does anyone know how to get through all the identifiers named _

So, for example, within the markup, I can have 50 identifiers that start with "name_", the full identifier will look like name_2, name_55, name_25, etc.

I would like to skip all these numbers.

I don’t know where to start ....... thanks!

+6
javascript jquery
source share
1 answer

use attribute with selector

$('[id^=name_]').each(function() { var number = this.id.split('_').pop(); }); 
+21
source share

All Articles