comparison default/node_modules/jquery/src/manipulation/getAll.js @ 0:1d038bc9b3d2 default tip

Up:default
author Liny <dev@neowd.com>
date Sat, 31 May 2025 09:21:51 +0800
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1d038bc9b3d2
1 define( [
2 "../core",
3 "../core/nodeName"
4 ], function( jQuery, nodeName ) {
5
6 "use strict";
7
8 function getAll( context, tag ) {
9
10 // Support: IE <=9 - 11 only
11 // Use typeof to avoid zero-argument method invocation on host objects (#15151)
12 var ret;
13
14 if ( typeof context.getElementsByTagName !== "undefined" ) {
15 ret = context.getElementsByTagName( tag || "*" );
16
17 } else if ( typeof context.querySelectorAll !== "undefined" ) {
18 ret = context.querySelectorAll( tag || "*" );
19
20 } else {
21 ret = [];
22 }
23
24 if ( tag === undefined || tag && nodeName( context, tag ) ) {
25 return jQuery.merge( [ context ], ret );
26 }
27
28 return ret;
29 }
30
31 return getAll;
32 } );