/ Published in: JavaScript
This function will sort an array of DOM elements in order of the DOM position. Useful when using calls such as $$("img.L,img.M") which doesn;t return a sorted element array.
It uses prototype but you can replace the Prototype.Browser stuff with anything else.
It uses prototype but you can replace the Prototype.Browser stuff with anything else.