Created
August 16, 2009 08:37
-
-
Save padolsey/168587 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
/* Place this at the very top of Sizzle() */ | |
var rContextID = /^\s*#(\S+)(?=\s+\S)/; | |
// Looking for "#id _somethingElseHere_" ... | |
if (!context && rContextID.test(selector)) { | |
context = document.getElementById( rContextID.exec(selector)[1] ); | |
selector = selector.replace(rContextID, ''); | |
} | |
// Then it continues with the remaining selector. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment