I need your help :) !
I have a page where there are a lot of tags and I have to retrieve in an array all id who begin by td_
I can not use the jQuery framework... Else there will be more easy...
Do you how I can do it ?
I need your help :) !
I have a page where there are a lot of tags and I have to retrieve in an array all id who begin by td_
I can not use the jQuery framework... Else there will be more easy...
Do you how I can do it ?
You can use the querySelector:
elementList = document.querySelectorAll('td[id^=td_]');
var nodeList = document.querySelectorAll('[id^=td_]'); // or if only TDs are tergated use: 'td[id^=td_]' instead {thx Derek}
var arr = []; // Will hold the array of Node's
for (var i = 0, ll = nodeList.length; i < ll; arr.push(nodeList[i++]));