Links
- MDN: Web/API/Event
- MDN: Web/Events: Event reference
- w3.org: DOM Level 3 Events
- w3.org: DOM Level 2: Interface Event
- w3.org: event handler processing algorithm
- The Event Object
- EventTarget
- Comparison of Event Targets
- Creating and triggering events
- Event Propagation
- Page Visibility
- MouseEvent
- Device orientation events
Snippets
// Simulating a mouse click. // Prereq: "element" that needs to be clicked. // An existing "event" var clickEvent = document.createEvent("MouseEvent"); clickEvent.initMouseEvent( "click", true, true, window, 0, event.screenX, event.screenY, event.clientX, event.clientY, event.ctrlKey, event.altKey, event.shiftKey, event.metaKey, 0, null); // simulate a click element.dispatchEvent(clickEvent);