Initial Commit
This commit is contained in:
28
node_modules/jquery/src/manipulation/getAll.js
generated
vendored
Normal file
28
node_modules/jquery/src/manipulation/getAll.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import { jQuery } from "../core.js";
|
||||
import { nodeName } from "../core/nodeName.js";
|
||||
import { arr } from "../var/arr.js";
|
||||
|
||||
export function getAll( context, tag ) {
|
||||
|
||||
// Support: IE <=9 - 11+
|
||||
// Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
|
||||
var ret;
|
||||
|
||||
if ( typeof context.getElementsByTagName !== "undefined" ) {
|
||||
|
||||
// Use slice to snapshot the live collection from gEBTN
|
||||
ret = arr.slice.call( context.getElementsByTagName( tag || "*" ) );
|
||||
|
||||
} else if ( typeof context.querySelectorAll !== "undefined" ) {
|
||||
ret = context.querySelectorAll( tag || "*" );
|
||||
|
||||
} else {
|
||||
ret = [];
|
||||
}
|
||||
|
||||
if ( tag === undefined || tag && nodeName( context, tag ) ) {
|
||||
return jQuery.merge( [ context ], ret );
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
Reference in New Issue
Block a user