The MDN documentation on addEventListener reads:
It works on any DOM element, not just HTML elements.
What DOM elements are not HTML elements? XML? Others?
You can add event listeners to any DOM object not only HTML elements. i.e the window object. Basically, all the statement is saying is that you are not confined to the HTML elements only.
The DOM is a W3C (World Wide Web Consortium) standard.
The DOM defines a standard for accessing documents:
"The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document."
The W3C DOM standard is separated into 3 different parts:
Core DOM - standard model for all document types
XML DOM - standard model for XML documents
HTML DOM - standard model for HTML documents
Here is a useful link which should give you more information about the HTML DOM http://www.w3schools.com/js/js_htmldom.asp.
You should also have a look at http://www.w3schools.com/js/js_htmldom_eventlistener.asp.
Here is the official W3C recommendation: http://www.w3.org/TR/DOM-Level-2-Core/introduction.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With