English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Descendant selectors select all elements that belong to a given ancestor.
The descendants of an element can be its children, grandchildren, great-grandchildren, and so on.
Note:Descendant selectors are used to select elements within an element.
$("ancestor descendant")
Select all <p> elements that are descendants of <div> elements:
$("document").ready(function(){ $("div p").css("background", "mediumpurple"); });Test See‹/›
Parameter | Description |
---|---|
ancestor | Any Valid Selector |
descendant | Selectors to Filter Descendant Elements |