3 <script type="text/javascript" src="../lib/Test/Builder.js"></script>
4 <script type="text/javascript" src="../lib/Test/More.js"></script>
5 <script type="text/javascript" src="../lib/test.js"></script>
6 <script type="text/javascript" src="../../jquery/jquery-svn.js"></script>
9 <h1>CSS 3 Selectors</h1>
12 <div id="main" style="display: none;">
13 <p id="firstp">See <a id="simon1" href="http://simon.incutio.com/archive/2003/03/25/#getElementsBySelector" rel="bookmark">this blog entry</a> for more information.</p>
15 Here are some links in a normal paragraph: <a id="google" href="http://www.google.com/" title="Google!">Google</a>,
16 <a id="groups" href="http://groups.google.com/">Google Groups</a>.
17 This link has <code><a href="#" id="anchor1">class="blog"</a></code>:
18 <a href="http://diveintomark.org/" class="blog" hreflang="en" id="mark">diveintomark</a>
21 <p id="sndp">Everything inside the red border is inside a div with
22 <code>id="foo"</code>.</p>
23 <p lang="en" id="en">This is a normal link:
24 <a id="yahoo" href="http://www.yahoo.com/" class="blogTest">Yahoo</a></p>
25 <p id="sap">This link has <code><a href="#2" id="anchor2">class="blog"</a></code>:
26 <a href="http://simon.incutio.com/" class="blog link" id="simon">Simon Willison's Weblog</a></p>
28 <p id="first">Try them out: </p>
32 <input type="text" value="Test" id="text1"/>
33 <input type="text" value="Test" id="text2" disabled="disabled"/>
34 <input type="radio" name="radio1" id="radio1"/>
35 <input type="radio" name="radio2" id="radio2" checked/>
36 <input type="checkbox" name="check" id="check1" checked/>
37 <input type="checkbox" name="check" id="check2"/>
41 <pre id="test"><script>
44 t( "Attribute Begins With", "a[@href ^= 'http://www']",
46 t( "Attribute Ends With", "a[@href $= 'org/']",
48 t( "Attribute Contains", "a[@href *= 'google']",
49 ["google","groups"] );
51 t( "First Child", "p:first-child",
53 t( "Last Child", "p:last-child",
56 t( "Only Child", "a:only-child",
57 ["simon1","anchor1","anchor2","yahoo"] );
59 t( "Empty", "ol:empty", ["empty"] );
61 t( "Enabled UI Element", "input:enabled",
62 ["text1","radio1","radio2","check1","check2"] );
63 t( "Disabled UI Element", "input:disabled",
66 t( "Checked UI Element", "input:checked",
67 ["radio2","check1"] );
69 t( "Text Contains", "a:contains('Google')",
70 ["google","groups"] );
71 t( "Text Contains", "a:contains('Google Groups')",
74 t( "Element Preceded By", "p ~ div", ["foo"] );
76 t( "Not", "a.blog:not(.link)", ["mark"] );