Skip to content

Instantly share code, notes, and snippets.

@rseon
rseon / $.hasParent
Created June 15, 2013 13:54
How to find parent of an element when you can't do $('.element').parent().parent()... ?
$.extend($.fn, {
hasParent: function(p) {
return this.filter(function(){
return $(p).find(this).length;
});
}
});