JavaScript: getElementsBySelector()

This article was first written in May 2005 for the BeezNest technical
website ( As of 2008, I don't
remember the source exactly, but the links will lead you to them.
Inspired by Andy, I decided to have a crack at something I've been thinking about trying for a long time. document.getElementsBySelector is a javascript function which takes a standard CSS style selector and returns an array of elements objects from the document that match that selector.