jQuery first() method
Example
Select the first
the first inside the element
element:
$("div p").first()
Try it »
Definition and Usage
The first() method returns the first element of the selected elements.
**Tip:** To return the last element, use last() method.
Syntax
$(
selector
).first()
More examples
the first in the collection of elements Element
How to select
the first in the collection of elements .
jQuery Traversal Methods