Created
November 4, 2008 17:56
-
-
Save subtleGradient/22177 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Element.implement({ | |
matchFromRoot: function(selector){ | |
return document.getElements(selector, true).contains(this); | |
} | |
}); | |
myElement.match('div') // true | |
myElement.match('body div') // false | |
myElement.matchFromRoot('div') // true | |
myElement.matchFromRoot('body div') // true | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment