Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery :parent Selector

jQuery :parent Selector

jQuery selector jQuery selector

Example

Select all elements that have child elements or contain text:

$("td:parent")

Try it »


Definition and Usage

The :parent selector selects all parent elements that contain child nodes or text nodes.

:parent is the :empty opposite.

An important thing to note is that the child elements involved in :parent (and :empty) include text nodes.


Syntax

$(":parent")


jQuery selector jQuery selector