jQuery Child elements


$("element:nth-child(index)")

Selects the Nth child element under the parent, the index starts at 1, and the eq function starts at zero.
Example :

:nth-child (even) // even
:nth-child (odd) // odd
:nth-child (3n) // expression
:nth-child (2) // index
:nth-child (3n + 1) // expression
:nth-child (3n + 2) // expression

$("element:first-child")

Matches the first child element under the parent


$("element:last-child")

Matches the last child element under the parent


$("element:only-child")

Matches a unique child element under the parent, for example, if dt is unique in the dl list, then dt will be selected




Copyright 2014-2017 by DeveloperTut.com. All Rights Reserved.
TwitterGoogle+Facebook