forked from jquery/api.jquery.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdescendant-selector.xml
44 lines (41 loc) · 1.39 KB
/
descendant-selector.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?xml version="1.0"?>
<entry type="selector" name="descendant" return="">
<title>Descendant Selector ("ancestor descendant")</title>
<sample>ancestor descendant</sample>
<signature>
<added>1.0</added>
<argument name="ancestor" type="Selector">
<desc>Any valid selector.</desc>
</argument>
<argument name="descendant" type="Selector">
<desc>A selector to filter the descendant elements.</desc>
</argument>
</signature>
<desc>Selects all elements that are descendants of a given ancestor.</desc>
<longdesc>
<p>A descendant of an element could be a child, grandchild, great-grandchild, and so on, of that element.</p>
</longdesc>
<example>
<desc>Finds all input descendants of forms.</desc>
<code><![CDATA[$("form input").css("border", "2px dotted blue");]]></code>
<css><![CDATA[
body { font-size:14px; }
form { border:2px green solid; padding:2px; margin:0;
background:#efe; }
div { color:red; }
fieldset { margin:1px; padding:3px; }
]]></css>
<html><![CDATA[<form>
<div>Form is surrounded by the green outline</div>
<label>Child:</label>
<input name="name" />
<fieldset>
<label>Grandchild:</label>
<input name="newsletter" />
</fieldset>
</form>
Sibling to form: <input name="none" />]]></html>
</example>
<category slug="selectors/hierarchy-selectors"/>
<category slug="version/1.0"/>
</entry>