Today I saw the original written code ~ suddenly thought of children (": EQ (2)") and Children (). EQ (2) is not the same ~ to combine their own hands ~ found it is the same, feel good rubbish by the way down. Accumulate a bit
The HTML structure is as follows
<div class= "Div" ><ul><li><span>hello</span>1</li><li><span> Hello</span>2</li><li><span>hello</span>3</li><li><span>hello </span>4</li><li><span>hello</span>5</li></ul><ul><li> <span>hello</span>11</li><li><span>hello</span>22</li><li>< Span>hello</span>33</li><li><span>hello</span>44</li><li><span >hello</span>55</li></ul><ul><li><span>hello</span>111</li> <li><span>hello</span>222</li><li><span>hello</span>333</li> <li><span>hello</span>444</li><li><span>hello</span>555</li> </ul><ul><li><span>hello</span>1111</li><li><span>hello</ Span>2222</li> <li><span>hello</span>3333</li><li><span>hello</span>4444</li ><li><span>hello</span>5555</li></ul></div>
Then introduce jquery to compare the difference between the two (there is no difference in the actual, that is, the writing method is not the same)
The code is as follows
$ (' ul '). Children (": EQ (1)"). CSS (' Color ', ' red '); $ (' ul '). Children (). EQ (2). CSS (' Color ', ' red ');
It's no different than changing to something else.
There is the difference between children () and find ()-the test found that the parentheses of find () must be written in-otherwise invalid
$ (' div '). Find (). EQ (2). CSS (' Color ', ' red ');
The following is a valid
$ (' div '). Find (' ul '). EQ (2). CSS (' Color ', ' red ');
The summary is: find () looks for descendants, descendants, children, and parameters must be filled
Children () itself is looking for the descendants, the parameters in the optional fill
jquery accumulates ~children (": eq ()") with Children (). EQ ()