mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Optimize jQuery() for the case $("TAG").
This commit is contained in:
@@ -109,6 +109,10 @@ jQuery.fn = jQuery.prototype = {
|
||||
return this;
|
||||
}
|
||||
|
||||
// HANDLE: $("TAG")
|
||||
} else if ( !context && /^\w+$/.test( selector ) ) {
|
||||
selector = document.getElementsByTagName( selector );
|
||||
|
||||
// HANDLE: $(expr, $(...))
|
||||
} else if ( !context || context.jquery ) {
|
||||
return (context || rootjQuery).find( selector );
|
||||
|
||||
Reference in New Issue
Block a user