diff options
Diffstat (limited to 'src/core.js')
-rw-r--r-- | src/core.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core.js b/src/core.js index 7ddb2c5b0..ff8114bb5 100644 --- a/src/core.js +++ b/src/core.js @@ -338,6 +338,17 @@ jQuery.fn = jQuery.prototype = { }) ), "filter", selector ); }, + closest: function( selector ) { + return this.map(function(){ + var cur = this; + while ( cur && cur.ownerDocument ) { + if ( jQuery(cur).is(selector) ) + return cur; + cur = cur.parentNode; + } + }); + }, + not: function( selector ) { if ( typeof selector === "string" ) // test special case where just one selector is passed in |