jQuery :only-child Selector

jQuery Selectors jQuery Selectors

Example

Select each <p> element that is the only child of its parent:

$("p:only-child")

Try it yourself »

Definition and Usage

The :only-child selector selects every element that is the only child of its parent.


Syntax

$(":only-child")

jQuery Selectors jQuery Selectors


SHARE THIS PAGE

COLOR PICKER

colorpicker





Search w3schools.com:

Translate w3schools.com: