Skip to content

Instantly share code, notes, and snippets.

@tiltedlistener
Created February 8, 2015 04:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiltedlistener/795ea00e24210177f443 to your computer and use it in GitHub Desktop.
Save tiltedlistener/795ea00e24210177f443 to your computer and use it in GitHub Desktop.
where() function for jQuery
(function ( $ ) {
$.fn.where = function(status) {
var len = this.size();
for(var i=0; i < len; i++) {
if ($(this[i]).is(status)) {
return $(this[i]);
}
}
return [];
};
}( jQuery ));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment