SyntaxFix
Write A Post
Hire A Developer
Questions
Try this
var div = document.getElementById("test"); var spans = div.getElementsByTagName("span"); for(i=0;i<spans.length;i++) { alert(spans[i].innerHTML); }