-
Notifications
You must be signed in to change notification settings - Fork 260
Expand file tree
/
Copy pathchild-selector.xml
More file actions
35 lines (35 loc) · 1.73 KB
/
child-selector.xml
File metadata and controls
35 lines (35 loc) · 1.73 KB
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
<entry type='selector' name="child" return="" >
<sample>parent > child</sample>
<signature>
<added>1.0</added>
<argument name="parent" type="Selector">
<desc>Any valid selector.</desc>
</argument>
<argument name="child" type="Selector">
<desc>A selector to filter the child elements.</desc>
</argument>
</signature>
<desc>Selects all direct child elements specified by "child" of elements specified by "parent".</desc>
<longdesc><p>As a CSS selector, the child combinator is supported by all modern web browsers including Safari, Firefox, Opera, Chrome, and Internet Explorer 7 and above, but notably not by Internet Explorer versions 6 and below. However, in jQuery, this selector (along with all others) works across all supported browsers, including IE6.</p>
<p>The child combinator (E <strong>></strong> F) can be thought of as a more specific form of the descendant combinator (E F) in that it selects only first-level descendants.</p>
<blockquote><p><strong>Note: </strong>The <code>$("> elem", context)</code> selector will be deprecated in a future release. Its usage is thus discouraged in lieu of using alternative selectors.</p></blockquote>
</longdesc>
<example>
<desc>Places a border around all list items that are children of <ul class="topnav"> .</desc>
<code><![CDATA[$("ul.topnav > li").css("border", "3px double red");]]></code>
<css><![CDATA[
body { font-size:14px; }
]]></css>
<html><![CDATA[
<ul class="topnav">
<li>Item 1</li>
<li>Item 2
<ul><li>Nested item 1</li><li>Nested item 2</li><li>Nested item 3</li></ul>
</li>
<li>Item 3</li>
</ul>
]]></html>
</example>
<category slug="selectors/hierarchy-selectors"/>
<category slug="version/1.0"/>
</entry>