In the past and with most my current projects I tend to use a for loop like this:
var elements = document.getElementsByTagName(\'div\'); for (var i=0; i
I think you have two alternatives. For dom elements such as jQuery and like frameworks give you a good method of iteration. The second approach is the for loop.