jeudi 27 mars 2014

GetElementById and A tags


Vote count:

0




Getting error on this:

for (i = 1; i <= 18; i++) {

oAllKits = myNode.getElementById('node' + i).getElementsByTagName('a');

}

I have a series of IDs on the html document called: node1, node2,... node18. I am trying to target the A tags on these IDs since these A tags are the only elements inside these ids. The console is giving me this message: # has no method 'getElementById'.

I am doing a for loop because I want the variable oAllKits to hold an all those A tags inside the Ids. Thank you advance for your help.



asked 37 secs ago






Aucun commentaire:

Enregistrer un commentaire