~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/webshell/tests/viewer/samples/test8dom.html

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<body>
 
3
<form>
 
4
<input type=button value="change value attribute" onclick="changeValues(0)"> &nbsp;
 
5
<button onclick="changeSizes()">change size attribute</button>
 
6
<BR>
 
7
<input type=button value="change checked attribute" onclick="changeChecked()"> &nbsp;
 
8
<BR>
 
9
<input type=submit value=submit>
 
10
<input type=reset value=reset>
 
11
<input type=button value=button>
 
12
<INPUT type=image src=raptor.jpg width=50 height=50 name=imageSubmit value="js bug">
 
13
<BR>
 
14
<input type=checkbox checked value="js bug">
 
15
<input type=checkbox value="js bug">
 
16
<input type=radio name=radio checked value="js bug">
 
17
<input type=radio name=radio value="js bug">
 
18
<BR>
 
19
<button>html4 button</button>
 
20
<input type=text value=foo>
 
21
<textarea>foobar</textarea>
 
22
</form>
 
23
 
 
24
<script>
 
25
 
 
26
var numInputChangers = 2; 
 
27
var inputs = document.getElementsByTagName("INPUT");
 
28
var numInputs = inputs.length;
 
29
var inputValues = new Array(numInputs+numInputs);
 
30
var start = 0;
 
31
for (var i = 0; i < numInputs; i++) {
 
32
  inputValues[i] = inputs[i].value; 
 
33
        inputValues[numInputs+i] = "CHANGED"
 
34
}
 
35
 
 
36
function changeValues(aNativeChanger) { 
 
37
        if (start == 0) {
 
38
                start = numInputs;
 
39
        } 
 
40
        else {
 
41
                start = 0;
 
42
        }
 
43
        for (var i = numInputChangers; i < numInputs; i++) {
 
44
                inputs[i].value = inputValues[start+i];
 
45
        }
 
46
}
 
47
 
 
48
function changeSizes() {
 
49
        inputs[2].size = 100;
 
50
        inputs[3].size = 100;
 
51
        inputs[4].size = 100;
 
52
        inputs[11].size = 10;
 
53
}
 
54
 
 
55
function changeChecked() {
 
56
        inputs[6].checked = false;
 
57
        inputs[7].checked = true;
 
58
        inputs[8].checked = false;
 
59
        inputs[9].checked = true;
 
60
}
 
61
</script>
 
62
 
 
63
</body>
 
64
</html>