For example, there are elements with identifiers:
index1 index2 index3
I want to change the background all at once. I imagine it like this:
var reg = new RegExp("\d"); document.getElementById('index' + reg).style.background='#000';
Explain, please, how to do it right? :)
upd: The number of items is unknown. Is it possible to do without jQuery?