HTML is an XML variant, and below is a small example of it. (If the following looks unfamiliar to you, then learn some basic HTML)
<p>This is an example of a DOM</p>
The birth of the DOM API
Therefore, the World Wide Web Consortium (W3C) stepped in and created a standard for creating with HTML. And so, DOM Level 1 was born.
The DOM API has two big groups of methods. The core: which is used for every XML based document and the DOM HTML extensions: for html specific objects and methods.
The internet evolved and so did the API. Level 1 focused on the structure of a document, whereas Level 2 added support for mouse and user-interface events as well as better Cascading Style Sheets (CSS) and traversal methods to iterate over a DOM document. Then came Level 3 which added load and save functionality and validation methods.
You might also hear about DOM level 0, but this never existed. NN4 and IE4 use it to reference to the original DHTML.
It’s only a recommendation
It’s not mandatory, no government enforced a browser manufacturer to use the standard. As a result, not all browsers support everything. A clear overview of which browser supports what is currently not available (read: I can’t find one). As a result, my first option is to go to ‘Can I use‘ and if I can’t find it there, I go to Mozzila’s Developer Network. It covers every method and function, and contains information about browser compatibility.
Hence, use feature detection if you implement an unsupported method. Otherwise you can prompt the user to upgrade to an other browser that does support the recommendations of the standard. Fortunately, most of the modern web browsers implement all of the Level 3 specification.
Question’s and Answers about the DOM
Do other XML based formats have an API?
There are numerous XML markup languages like HTML, furthermore, each comes with it’s own API. They come in all shapes and sizes. A web-based environment uses multiple,but some are only server-side and others represent specific research data and such. Some XML variants: Documents (HTML, XHTML), Graphics (SVG, XAML), Mathematics (MathML, CellML), Multimedia presentations (SMIL), Authentication and Authorization (SAML), web feeds (Atom) and many more…
Is DOM and HTML the same?