public marks

PUBLIC MARKS from fredbird with tags css & dom

December 2005

Robert’s talk » The Ultimate getElementsByClassName

by 5 others
To get all a elements in the document with a “info-links” class. getElementsByClassName(document, "a", "info-links"); To get all div elements within the element named “container”, with a “col” class. getElementsByClassName(document.getElementById("container"), "div", "col"); To get all elements within in the document with a “click-me” class. getElementsByClassName(document, "*", "click-me");

June 2005

Simon Willison: getElementsBySelector()

by 2 others (via)
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.

May 2005