English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Child selectors (>) select all elements that are direct children of the specified element.
Note:Child selectors are used to select elements within an element.
$("parent > child")
Select all <p> elements that are direct children of the <div> element:
$("document").ready(function(){ $("div > p").css("background", "mediumpurple"); });Test and See‹/›
Parameter | Description |
---|---|
parent | Any valid selector |
child | Selector for Filtering Child Elements |