Javascript optimisation - while
var i = 0, el, els = document.getElementsByTagName(nodeName); while (el = els[i++]) { // [...] }
Using a while loop and storing the live collection in a variable is the quickest technique in all of these browsers.
TextSnippets > metafeather > qa
1390 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
Liam Clancy http://www.metafeather.net/
var i = 0, el, els = document.getElementsByTagName(nodeName); while (el = els[i++]) { // [...] }