GO-V.ORG
As seen in

DOM event

DOM (Document Object Model) Events are a signal that something has occurred, or is occurring, and can be triggered by user interactions or by the browser.[src] Client-side scripting languages like JavaScript, JScript, VBScript, and Java can register various event handlers or listeners on the element nodes inside a DOM tree, such as in HTML, XHTML, XUL, and SVG documents.[src] Examples of DOM Events: * When a user clicks the mouse * When a web page has loaded * When an image has been loaded * When the mouse moves over an element * When an input field is changed * When an HTML form is submitted * When a user presses a key Historically, like DOM, the event models used by various web browsers had some significant differences which caused compatibility problems.[src] To combat this, the event model was standardized by the World Wide Web Consortium (W3C) in DOM Level 2.[src]

DOM (Document Object Model) Events are a signal that something has occurred, or is occurring, and can be triggered by user interactions or by the browser.[src] Client-side scripting languages like JavaScript, JScript, VBScript, and Java can register various event handlers or listeners on the element nodes inside a DOM tree, such as in HTML, XHTML, XUL, and SVG documents.[src] Examples of DOM Events: When a user clicks the mouse When a web page has loaded When an image has been loaded When the mouse moves over an element When an input field is changed When an HTML form is submitted When a user presses a key Historically, like DOM, the event models used by various web browsers had some significant differences which caused compatibility problems.[src] To combat this, the event model was standardized by the World Wide Web Consortium (W3C) in DOM Level 2.[src] The bubble phase (optional): the event travels back up from the target of an event to the root event target.[src] The bubble phase will only occur for events that bubble (where event.bubbles == true ) You can find a visualization of this event flow at https://domevents.dev Inline Event Handling Inline Event Handling Hey Joe ![src] function triggerAlert(name) { window.alert("Hey " + name); } One common misconception with the inline model is the belief that it allows the registration of event handlers with custom arguments, e.g.[src] name in the triggerAlert function.[src] While it may seem like that is the case in the example above, what is really happening is that the JavaScript engine of the browser creates an anonymous function containing the statements in the onclick attribute.[src] The onclick handler of the element would be bound to the following anonymous function: function () { triggerAlert('Joe'); return false; } This limitation of the JavaScript event model is usually overcome by assigning attributes to the function object of the event handler or by using closures.[src] Traditional Event Handling Traditional Event Handling Hey Joe![src] var triggerAlert = function () { window.alert("Hey Joe"); }; // Assign an event handler document.onclick = triggerAlert; // Assign another event handler window.onload = triggerAlert; // Remove the event handler that was just assigned window.onload = null; To add parameters: var name = 'Joe'; document.onclick = (function (name) { return function () { alert('Hey ' + name + '!'); }; }(name)); Inner functions preserve their scope.[src] DOM Level 2 DOM Level 2 Hey Joe![src] var heyJoe = function () { window.alert("Hey Joe!"); } // Add an event handler document.addEventListener( "click", heyJoe, true ); // capture phase // Add another event handler window.addEventListener( "load", heyJoe, false ); // bubbling phase // Remove the event handler just added window.removeEventListener( "load", heyJoe, false ); Internet Explorer-specific model Internet Explorer-specific model Hey Joe![src] var heyJoe = function () { window.alert("Hey Joe!"); } // Add an event handler document.attachEvent("onclick", heyJoe); // Add another event handler window.attachEvent("onload", heyJoe); // Remove the event handler just added window.detachEvent("onload", heyJoe);[src]

19 sentences · 19 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"DOM event." encyclopegia.org, 2025, https://encyclopegia.org/wiki/dom-event. Accessed 05 December 2026.

Chicago

"DOM event." encyclopegia.org. Accessed December 5, 2026. https://encyclopegia.org/wiki/dom-event.

APA

encyclopegia.org. (2025). DOM event. Retrieved December 5, 2026, from https://encyclopegia.org/wiki/dom-event

Accessed December 5, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

h-event

stub · references available

Wartesaal am Dom

stub · references available

Beyond the Blue Event Horizon

stub · references available

Jeanny Dom

stub · references available

Sliezsky Dom

stub · references available

European Tour 2012/2013 – Event 3

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1267067316 · 0.5 · snapshot enwiki-001267067316

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners
  • Index — every corpus, paper and record
  • Estate guide — what a public data estate is
  • Founder — Lois-Kleinner Alpasan
  • Records — DOIs and external deposits
  • Documents — one-pagers, PDFs and QR codes
  • Brand kit — logos and share images
  • Papers — plain-language briefs with citations
  • Browser — search engine, PWA and bookmarklet
  • Anticloud — the operator and its projects

As seen in Business Insider · 336 outlets · evidence DOIs · plain-language papers

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.