<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Selectors</title>
<link rel="stylesheet" href="css/select.css" type="text/css" />
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/select.js" type="text/javascript"></script>
<script src="js/jquery.DOMWindow.js" type="text/javascript"></script>
</head>
<body>
<div id="container">
<h1>
jQuery Selectors
</h1>
<div class="section">
<!-- DOM树 -->
<div class="domtree">
<h3>
Toggle Button = <code>$('selector').addClass('highlight').animate({ marginLeft: 10},'fast');</code>
</h3>
<p>
<a href="http://www.codylindley.com/jqueryselectors.zip" title="Download These Files"
rel="">Download These Files</a>
</p>
<div id="myid">
This sentence is in <code><div id="myid"></code>. It is followed by a horizontal
rule.
</div>
<hr />
<p>
This is a paragraph, which means it is wrapped in <code><p></code>
<span>and</span><code></p></code>. Those "p" tags in the previous sentence
are formatted as <code><code></code>.
</p>
<ul>
<li>This is the first list item (<code><li></code>) in an unordered list (<code><ul></code>).
</li>
<li>This is the second list item. It has a
<a rel="self" title="Learning jQuery blog" href="#">link</a>
in it.</li>
<li class="myclass otherclass">This is the third list item. It has a <code>class</code>
of "myclass otherclass"</li>
<li>This is the fourth list item. It has <strong>strong</strong> text and <em>em</em>phasized
<em>text</em>.
<ul>
<li>second-level list item 1</li>
<li>second-level list item 2</li>
</ul>
</li>
</ul>
<p class="myclass">
<code><p class="myclass"></code>This is another paragraph. It has class="myclass"
Otherwise, nothing <strong>special</strong> about it at all.
</p>
<p>
This is a paragraph, which means it is wrapped in <code><p></code> and <code></p></code>.
Those "p" tags in the previous sentence are formatted as <code>.
</p>
<form action="" method="get" accept-charset="utf-8">
<div class="left">
<div>
<input type="text" value="text input" />
</div>
<div>
<input type="text" value="disabled text input" disabled="disabled" />
</div>
<div>
<input type="password" name="password" value="password" />
</div>
<div>
<select>
<option>select list w/ options</option>
<option>another option</option>
<option>a third option</option>
</select>
</div>
</div>
<textarea class="left" rows="5" cols="20">This is a textarea</textarea>
<div>
<select size="5" style="margin-left: 10px">
<option>select list w/ options</option>
<option selected="selected">another option</option>
<option>a third option</option>
</select>
</div>
<div class="clear-left">
<label for="radio1">
<input class="left" name="radiobtn" type="radio" id="radio1" value="checkedradio"
checked="checked" />
Radio Checked
</label>
<label class="left clear-left" for="radio2">
<input class="left" id="radio2" name="radiobtn" type="radio" value="not" />
Radio Not Checked
</label>
<label class="left clear-left" for="check1">
<input class="left" id="check1" name="checkbx" type="checkbox" value="checked" checked="checked" />
Checkbox Checked
</label>
<label class="left clear-left" for="check2">
<input class="left" id="check2" name="checkbx" type="checkbox" value="not" />
Checkbox Not Checked
</label>
<label class="left clear-left" for="check3">
<input class="left" id="check3" name="checkbx" type="checkbox" value="not" />
Another checkbox Not Checked
</label>
</div>
<div class="left clear-left">
<input type="submit" value="Submit input" />
</div>
<div class="left">
<input type="button" value="Button input" />
</div>
<div class="left">
<input type="reset" value="Reset input" />
</div>
<div class="left">
<input type="image" src="img/animationProcessing.gif" value="Image input" />
</div>
<div class="left">
<button>
Button button</button>
</div>
<div class="left clear-left">
<input type="file" name="fileinput" value="file input" id="fileinput" />
</div>
</form>
</div>
<!-- /DOM树 -->
<!-- 选择器示例 -->
<!-- 用户自定义 -->
<div class="example">
<h3>
Enter Your Own Selectors ( example: li:nth-child(2) )
</h3>
<textarea rows="3" cols="20" id="customInput" style="width: 250px;">li:nth-child(2)</textarea>
<input type="submit" value="toggle" id="toggleCustom" />
</div>
<!-- 基本选择器 -->
<div class="example">
<h3>
Basics
</h3>
<div class="content">
<!-- 匹配 myid 的一个元素 -->
<div class="sample-code">
$('<span class="querystring">#myid</span>')
</div>
<input type="submit" value="toggle" />
<!-- 匹配元素 code 的所有元素 -->
<div class="sample-code">
$('<span class="querystring">code</span>')
</div>
<input type="submit" value="toggle" />
<!-- 匹配类 myclass 的所有元素 -->
<div class="sample-code">
$('<span class="querystring">.myclass</span>')
</div>
<input type="submit" value