:first-child selector

:first-child Selector

first-child selector

Description: Selects all elements that are the first child of their parent.

  • version added: 1.1.4jQuery( ":first-child" )

While :first matches only a single element, the :first-child selector can match more than one: one for each parent. This is equivalent to :nth-child(1).

Example:

Fi