jQuery :first-childSelector
Definition and Usage
The :first-child selector selects the first child element of its parent.
Tip:Please use:last-childselector to select the last child element of its parent.
Syntax
$(":first-child")
Try it Yourself - Examples
Select the first <p> element of all <div> elements
How to select the first <p> element of all <div> elements.
The difference between :first and :first-child
Demonstrates the difference between the :first and :first-child selectors.
The difference between :first, :first-child, and :first-of-type
Demonstrates the difference between the :first, :first-child, and :first-of-type selectors.
Other Extensions
jQuery Selectors