Can jQuery or JavaScript be used with a regex to select multiple elements with similar id?
I have the following paragraphs:
You can use next code if you want to do any other action:
$('[id^="item"]').each(function(){ if(this.id.slice(-1) == 2){ //Do something $(this).html('D'); } });