5 var handler = new Object;
6 handler.handleEvent = function (event) {
7 document.getElementById("console").appendChild(document.createTextNode("Received event: " + event));
11 if (window.testRunner)
12 testRunner.dumpAsText();
14 document.addEventListener("event", handler, false);
15 var event = document.createEvent("Event");
16 event.initEvent("event", true, true);
17 document.dispatchEvent(event);
22 <body onload="test()">
23 <p>This test creates and sends an event to a handler that's implemented with a handleEvent function.
24 If the test succeeds, there will be text below saying "Received event".</p>
25 <div id="console"></div>