source: Dev/trunk/src/client/dojo/tests/_base/html_id.html

Last change on this file was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 2.4 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2        "http://www.w3.org/TR/html4/strict.dtd">
3<!--
4        we use a strict-mode DTD to ensure that the box model is the same for these
5        basic tests
6-->
7<html>
8        <head>
9                <title>testing Core HTML/DOM/CSS/Style utils: dojo.byId</title>
10                <style type="text/css">
11                        @import "../../resources/dojo.css";
12                </style>
13                <script type="text/javascript" src="../../dojo.js" data-dojo-config="isDebug:true"></script>
14                <script type="text/javascript">
15                        require(["dojo", "doh", "dojo/domReady!"], function(dojo, doh){
16                       
17                                doh.register("t",
18                                        [
19                                                function byId(t){
20                                                        doh.f(dojo.byId(null));
21                                                        doh.f(dojo.byId(undefined));
22
23                                                        doh.f(dojo.byId("baz"));
24                                                        doh.f(dojo.byId("foobar"));
25                                                        doh.f(dojo.byId("dude"));
26                                                        doh.f(dojo.byId("cattle"));
27                                                        doh.f(dojo.byId("cattle2"));
28
29                                                        doh.f(dojo.byId("lamps"));
30                                                        doh.f(dojo.byId("blue"));
31                                                        doh.t(dojo.byId("chairs"));
32                                                       
33                                                        doh.t(dojo.byId("ranch"));
34                                                        doh.t(dojo.byId("cattle3"));
35                                                        doh.is("span", dojo.byId("fish").nodeName.toLowerCase());
36                                                       
37                                                        var startNode = dojo.byId("start");
38                                                        var clonedNode = dojo.clone(startNode);
39                                                        clonedNode.id= "clonedStart";
40                                                        clonedNode.innerHTML= "This is a cloned div";
41                                                        dojo.body().appendChild(clonedNode);
42
43                                                        doh.is("This is a cloned div", dojo.byId("clonedStart").innerHTML);
44                                                }
45                                        ]
46                                );
47                                doh.runOnLoad();
48
49                        });
50                </script>
51        </head>
52        <body>
53                <h1>testing Core DOM utils: dojo.byId</h1>
54               
55                <form name="foobar">
56                        <input type="text" name="baz" value="baz1">
57                        <input type="text" name="baz" value="baz2">
58                </form>
59               
60                <form name="dude"></form>
61
62                <form name="ranch">
63                        <input type="text" name="cattle" id="ranch" value="baz1">
64                </form>
65               
66                <form name="ranch2">
67                        <input type="text" name="cattle2" value="baz1">
68                </form>
69               
70                <form name="ranch3">
71                        <input type="text" name="cattle3" value="baz1">
72                        <input type="text" name="cattle3" id="cattle3" value="cattle3">
73                </form>
74               
75                <form name="sea">
76                        <input type="text" name="fish" value="fish">
77                        <input type="text" name="turtle" value="turtle">
78                </form>
79                <span id="fish">Fish span</span>
80                               
81                <form name="lamps">
82                        <input type="text" name="id" value="blue">
83                </form>
84
85                <form name="chairs" id="chairs">
86                        <input type="text" name="id" value="recliner">
87                </form>
88
89                <div id="start">a start node</div>
90               
91        </body>
92</html>
Note: See TracBrowser for help on using the repository browser.