Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (37 sloc) 1.638 kB
<?xml version="1.0"?>
<entry type="selector" name="child" return="">
<title>Child Selector ("parent &gt; child")</title>
<sample>parent &gt; 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>&gt;</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>
</longdesc>
<example>
<desc>Places a border around all list items that are children of &lt;ul class="topnav"&gt; .</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>
Jump to Line
Something went wrong with that request. Please try again.