3 <title>Untitled
</title>
4 <script type=
"text/javascript">
7 testRunner
.dumpAsText();
11 var span
= document
.createElement("span");
12 span
.innerHTML
= msg
+ '<br>';
13 document
.getElementById("console").appendChild(span
);
16 var changeEventCount
= 0;
19 var cb
= document
.getElementById("myCheckbox");
21 // This line should not fire a change event
22 cb
.checked
= !cb
.checked
;
24 // This line should fire a change event
27 // This line should not fire a change event
28 cb
.setAttribute("checked", "checked");
30 if (changeEventCount
!= 1) {
31 debug("FAIL: expected 1 change event, got " + changeEventCount
);
33 debug("PASS: got exactly one change event.");
39 <body onload=
"main();">
40 <p>This test checks that programmaticly changing the checked state of
41 a checkbox does not fire the
"change" event (but user action like
42 calling
"click" does).
</p>
43 <div id=
"console"></div>
44 <input type=
"checkbox" id=
"myCheckbox" onchange=
"changeEventCount++">