Skip to content

Instantly share code, notes, and snippets.

@74togo
Last active December 21, 2015 00:58
Show Gist options
  • Save 74togo/6224233 to your computer and use it in GitHub Desktop.
Save 74togo/6224233 to your computer and use it in GitHub Desktop.
A super selector for jQuery
/*
Recursively searches the document, and the iframes within it for elements.
Usage: exactly like jQuery() or $()
*/
var $$$ = function(thing, doc) {
var res = $(thing, doc);
$("iframe", doc).each( function(){
res = res.add( $$$(thing, this.contentDocument) );
});
return res;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment