1 import { jQuery } from "../core.js";
2 import { nodeName } from "../core/nodeName.js";
4 export function getAll( context, tag ) {
6 // Support: IE <=9 - 11+
7 // Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
10 if ( typeof context.getElementsByTagName !== "undefined" ) {
11 ret = context.getElementsByTagName( tag || "*" );
13 } else if ( typeof context.querySelectorAll !== "undefined" ) {
14 ret = context.querySelectorAll( tag || "*" );
20 if ( tag === undefined || tag && nodeName( context, tag ) ) {
21 return jQuery.merge( [ context ], ret );