Latest web development tutorials

jQuery: only-child selector

jQuery selector jQuery selector

Examples

Each <p> element of its parent element belonging select only child elements:

$("p:only-child")

try it"

Definition and Usage

: Only-child selector to select each of the elements belonging to its parent element only child elements.


grammar

$(":only-child")


jQuery selector jQuery selector