Skip to content

Instantly share code, notes, and snippets.

@nkohari
Created October 14, 2009 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nkohari/210257 to your computer and use it in GitHub Desktop.
Save nkohari/210257 to your computer and use it in GitHub Desktop.
(function($) {
$.fn.extend({
equals: function(match) {
if (!match || !match.length || this.length != match.length)
return false;
for (var idx = 0, len = match.length; idx < len; idx++) {
if (this[idx] != match[idx])
return false;
}
return true;
},
contains: function(element) {
return $(this).children().index(element) != -1;
}
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment