Easy Tutorial
❮ Css Position Traversing Each ❯

jQuery first() Method

jQuery Traversal Methods

Example

Select the first <p> element within the first <div> element:


Definition and Usage

The first() method returns the first element of the selected elements.

Tip: To return the last element, use the last() method.


Syntax


More Examples

Select the first <span> element within a collection of <p> elements


jQuery Traversal Methods

❮ Css Position Traversing Each ❯