jQuery Tutorial Tutorials - jQuery :first-of-type selector

:first-of-type selector

The jQuery :first-of-type selector is used to select the elements that are the first among siblings and have no other element with both the same parent and the same elemetn name coming before it in the document tree.

jQuery :first-of-type selector Syntax

$(':first-of-type')

jQuery :first-of-type selector Examples

Following is a simple example which would hightlight the first p in each matched div:

Try now

Date:2019-08-18 11:27:50 From:www.Lautturi.com author:Lautturi