Description: Selects the first matched element.
version added: 1.0jQuery( ":first" )
:first pseudo-class is equivalent to
:eq(0). It could also be written as
:lt(1). While this matches only a single element, :first-child can match more than one: One for each parent.
:firstis a jQuery extension and not part of the CSS specification, queries using
:firstcannot take advantage of the performance boost provided by the native DOM
querySelectorAll()method. To achieve the best performance when using
:firstto select elements, first select the elements using a pure CSS selector, then use
- Selected elements are in the order of their appearance in the document.
Finds the first table row.