Official jQuery website
When studying the source code today, we found that native conversion can be performed without using get () and native methods.
Native-jQuery object
Var obj = document. xxx
((Obj).css ();
You can also directly $ (document. xxx)
JQuery object-native
Method 1: get ()
$ ('Lil'). get ();
This is because the set of elements obtained by jq is converted to a native object. In get (), parameters can also be placed to indicate that the currently converted element can use the native method.
Many questions about the difference between eq () and get:
It is very simple. If you use eq (), you cannot use the native method later. It is followed by the jq method.
Certificate ('input'0000.eq(1).css ('background', 'blue ')
Instead, if get () is used, you can only use the native method.
$ ('Input'). get (1). style. background ('blue ')
Method 2: Use the subscript directly, that is, in some cases, you can save get (). Second, you can directly use the native method to accomplish what you want to do. Isn't it more convenient?
Test 1: loop
Test 2: Form
Test 3: After the subscript is added, an error is reported when jq is used.