Can jQuery or JavaScript be used with a regex to select multiple elements with similar id?
I have the following paragraphs:
The best way to go is to use the following jQuery selectors
^= is starts with $= is ends with = is exactly equal != is not equal *= is contains
So in your case:
var $items = $('[id^="item"][id$="2"]');