: EQ (Index)
An element that matches a given index value
Index: Counting starting from 0
$ ("UL Li:eq (3)")//element of index position 0 starts counting, so here's 3 actually for the 4th element
$ ("ul"). Find ("Li"). EQ (3) //Using jquery Traversal method eq ()
EQ (index|-index)
get the first n Elements
Index
An integer that indicates the position of the element based on 0, and the position of the element is calculated from 0.
-index
An integer that indicates the position of the element, starting from the last element in the collection. (1 count)
Gets the second element of a match
<p> this was just a test.</p> <p> so is this</p>
$ ("P"). EQ (1) or $ ("P"). EQ (-1)
Apps:tab tab
If
$ (' Div.tab_box > div ')//Select child nodes
. EQ (index). Show (). siblings (). Hide ();
This will enable the tab switch effect,
if $ (' Div.tab_box > Div:eq (Index) ')
. Show (). siblings (). Hide ()
You can't switch.
Explain:
:eq () selector to write variable, that is, index is dynamic change, you need to use + + connection,
that is:$ ('div.tab_box > Div:eq ('+index+')')
Note: The preceding quotation marks are a pair, the following quotation marks are a pair, or you can precede a pair of quotation marks with double quotes, followed by single quotes.
both of these methods enable the Dynamic Selection tab tab.
This article is from the "7540036" blog, please be sure to keep this source http://7550036.blog.51cto.com/7540036/1859893
Usage and comparison of Jquery:eq selector and EQ () methods