Quick change to the license.
[jquery.git] / build / test / tests / custom.html
1 <html id="html">
2 <head>
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>
7 </head>
8 <body id="body">
9         <h1>Custom Expressions</h1>
10
11         <!-- Test HTML -->
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> 
14                         for more information.</p>
15                 <p id="ap">Here are some links in a normal paragraph: 
16                         <a id="google" href="http://www.google.com/" title="Google!">Google</a>, 
17                         <a id="groups" href="http://groups.google.com/">Google Groups</a>. 
18                         This link has <code><a href="#" id="anchor1">class="blog"</a></code>: 
19                         <a href="http://diveintomark.org/" class="blog" hreflang="en" id="mark">diveintomark</a>
20                 </p>
21                 <div id="foo">
22                         <p id="sndp">Everything inside the red border is inside a div with 
23                                 <code>id="foo"</code>.</p>
24                         <p lang="en" id="en">This is a normal link: 
25                                 <a id="yahoo" href="http://www.yahoo.com/" class="blogTest">Yahoo</a></p>
26                         <p id="sap">This link has <code><a href="#2" id="anchor2">class="blog"</a></code>: 
27                                 <a href="http://simon.incutio.com/" class="blog link" id="simon">Simon Willison's Weblog</a></p>
28                 </div>
29                 <p id="first">Try them out: </p>
30                 <ol id="empty"></ol>
31                 <form id="form">
32                         <input type="hidden" value="Test" id="hidden"/>
33                         <input type="text" value="Test" id="text1" style="display:none;"/>
34                         <input type="text" value="Test" id="text2" disabled="disabled"/>
35                         <input type="radio" name="radio1" id="radio1"/>
36                         <input type="radio" name="radio2" id="radio2" checked/>
37                         <input type="checkbox" name="check" id="check1" checked/>
38                         <input type="checkbox" name="check" id="check2" style="visibility:hidden;"/>
39                 </form>
40         </div>
41         
42         <pre id="test"><script>
43                 plan({tests: 11});
44                 
45                 t( "nth Element", "p:nth(1)", ["ap"] );
46                 t( "First Element", "p:first", ["firstp"] );
47                 t( "Last Element", "p:last", ["first"] );
48                 t( "Even Elements", "p:even", ["firstp","sndp","sap"] );
49                 t( "Odd Elements", "p:odd", ["ap","en","first"] );
50                 
51                 t( "Position Equals", "p:eq(1)", ["ap"] );
52                 t( "Position Greater Than", "p:gt(0)",
53                         ["ap","sndp","en","sap","first"] );
54                 t( "Position Less Than", "p:lt(3)",
55                         ["firstp","ap","sndp"] );
56                 
57                 t( "Is A Parent", "p:parent", 
58                         ["firstp","ap","sndp","en","sap","first"] );
59                 
60                 t( "Is Visible", "input:visible", 
61                         ["text2","radio1","radio2","check1"] );
62                 t( "Is Hidden", "input:hidden", 
63                         ["hidden","text1","check2"] );
64         </script></pre>
65 </body>
66 </html>