1 import { jQuery } from "../core.js";
2 import { nodeName } from "../core/nodeName.js";
3 import { arr } from "../var/arr.js";
5 export function getAll( context, tag ) {
7 // Support: IE <=9 - 11+
8 // Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
11 if ( typeof context.getElementsByTagName !== "undefined" ) {
13 // Use slice to snapshot the live collection from gEBTN
14 ret = arr.slice.call( context.getElementsByTagName( tag || "*" ) );
16 } else if ( typeof context.querySelectorAll !== "undefined" ) {
17 ret = context.querySelectorAll( tag || "*" );
23 if ( tag === undefined || tag && nodeName( context, tag ) ) {
24 return jQuery.merge( [ context ], ret );