function C( c, // className n, // nodeList r, // result i // index ){ // initialize result array r = r || []; // walk nodeList or an array containing "this" (node from which it is called) for (i in n=n || !i && [this]) // recursively iterate over children (use .childNodes for document, alas // this breaks the 140bytes barrier) C(c,(i=n[i]).children,r,1), // create RegExp through eval to test for className, add to result if present eval('/\\b' + c + '\\b/').test(i.className) && r.push(i); // return result return r }