How can I put the results of getElementsByTagName into the 'anchors' array for each of the tags in the 'myTags' array? This is what I have so far but I'm stuck. Any help would be much appreciated. :) Thanks.
var myTags = new Array("a", "abbr", "img", "p");
var anchors = new Array()
for (var i = 0; i < myTags.length; i ++) {
var myTag = myTags[i];
var anchors = document.getElementsByTagName(myTag);
}
Question
fmxer
How can I put the results of getElementsByTagName into the 'anchors' array for each of the tags in the 'myTags' array? This is what I have so far but I'm stuck. Any help would be much appreciated. :) Thanks.
Link to comment
Share on other sites
11 answers to this question
Recommended Posts