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

:only-of-type selector

The jQuery :only-of-type selector is used to select all elements that have no siblings with the same element name.

jQuery :only-of-type selector Syntax

$(':only-of-type')

jQuery :only-of-type selector Examples

In below example,We will hightlight each p tag element that is the only child p element of its parent.
Try now

Date:2019-08-18 13:08:45 From:www.Lautturi.com author:Lautturi