- Document Object Model
- HTML and HTML5
- Dynamic HTML
- XHTML Mobile Profile and C-HTML
- Canvas element
- Character encodings
- Document Object Model
- Font family
- HTML editor
- HTML element
- HTML Frames
- HTML5 video
- HTML scripting
- Web browser engine
- Quirks mode
- Style sheets
- Unicode and HTML
- W3C and WHATWG
- Web colors
- Web Storage
- Comparison of
The Document Object Model (DOM) is a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents. Aspects of the DOM (such as its "Elements") may be addressed and manipulated within the syntax of the programming language in use. The public interface of a DOM is specified in its application programming interface (API).
Legacy DOM was limited in the kinds of elements that could be accessed. Form, link and image elements could be referenced with a hierarchical name that began with the root document object. A hierarchical name could make use of either the names or the sequential index of the traversed elements. For example, a form input element could be accessed as either "document.formName.inputName" or "document.forms.elements".
The Legacy DOM enabled client-side form validation and the popular "rollover" effect.
The Intermediate DOMs enabled the manipulation of Cascading Style Sheet (CSS) properties that influence the display of a document. They also provided access to a new feature called "layers" via the "document.layers" property (Netscape Navigator) and the "document.all" property (Internet Explorer). Because of the fundamental incompatibilities in the Intermediate DOMs, cross-browser development required special handling for each supported browser.
Subsequent versions of Netscape Navigator abandoned support for its Intermediate DOM. Internet Explorer continues to support its Intermediate DOM for backwards compatibility.
After the release of ECMAScript, W3C began work on a standardized DOM. The initial DOM standard, known as "DOM Level 1," was recommended by W3C in late 1998. About the same time, Internet Explorer 5.0 shipped with limited support for DOM Level 1. DOM Level 1 provided a complete model for an entire HTML or XML document, including means to change any portion of the document. Non-conformant browsers such as Internet Explorer 4.x and Netscape 4.x were still widely used as late as 2000.
DOM Level 2 was published in late 2000. It introduced the "getElementById" function as well as an event model and support for XML namespaces and CSS. DOM Level 3, the current release of the DOM specification, published in April 2004, added support for XPath and keyboard event handling, as well as an interface for serializing documents as XML.
By 2005, large parts of W3C DOM were well-supported by common ECMAScript-enabled browsers, including Microsoft Internet Explorer version 6 (2001), Opera, Safari and Gecko-based browsers (like Mozilla, Firefox, SeaMonkey and Camino).
When an HTML page is rendered in a browser, the browser assembles all the elements (objects) that are contained in the HTML page, downloaded from web-server in its memory. Once done the browser then renders these objects in the browser window as text, forms, input boxes, etc. Once the HTML page is rendered in web-browser window, the browser can no longer recognize individual HTML elements (Objects).
The HTML objects, which belong to the DOM, have a descending relationship with each other.
The topmost object in the DOM is the Navigator (i.e. Browser) itself. The next level in the DOM is the browser's Window, and under that are the Documents displayed in Browser's Window.
DOM |-> Window |-> Document |-> Anchor |-> Link |-> Form |-> Text-box |-> Text Area |-> Radio Button |-> Check Box |-> Select |-> Button
Levels of DOM
Three levels or parts of DOM exist:
- The Core DOM: standard model for any structured document
- The HTML DOM: standard model for HTML documents
- The XML DOM: standard model for XML documents
Because DOM supports navigation in any direction (e.g., parent and previous sibling) and allows for arbitrary modifications, an implementation must at least buffer the document that has been read so far (or some parsed form of it).
Web browsers rely on layout engines to parse HTML into a DOM. Some layout engines such as Trident/MSHTML and Presto are associated primarily or exclusively with a particular browser such as Internet Explorer and Opera respectively. Others, such as WebKit and Gecko, are shared by a number of browsers, such as Safari, Google Chrome, RockMelt, Firefox or Flock. The different layout engines implement the DOM standards to varying degrees of compliance.
APIs that expose DOM implementations:
- JAXP (Java API for XML Processing) is an API for accessing DOM providers
- ^ a b "What is the DOM?". http://www.w3schools.com/: W3 Schools. http://www.w3schools.com/dom/dom_intro.asp. Retrieved 2011-04-20. "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 DOM is separated into three different parts/levels: Core DOM: standard model for any structured document, XML DOM: standard model for XML documents, and HTML DOM: standard model for HTML documents"
- Koch, Peter-Paul (May 14, 2001). "The Document Object Model: an Introduction". Digital Web Magazine. http://www.digital-web.com/articles/the_document_object_model/. Retrieved January 10, 2009.
- Le Hégaret, Philippe (2002). "The W3C Document Object Model (DOM)". World Wide Web Consortium. http://www.w3.org/2002/07/26-dom-article.html. Retrieved January 10, 2009.
- Guisset, Fabian. "What does each DOM Level bring?". Mozilla Developer Center. Mozilla Project. https://developer.mozilla.org/en/docs/DOM_Levels. Retrieved January 10, 2009.
- Ajax—a methodology employing DOM in combination with techniques for retrieving data without reloading a page.
- Application Object Model
- DOM scripting
- JDOM—a Java-based document object model for XML that integrates with DOM and SAX and uses parsers to build the document.
- RapidXml—is an attempt to create the fastest XML parser possible using modern C++.
- SAX—serial access parser API for XML, an alternative to DOM.
- SXML—a model for representing XML and HTML in the form of S-expressions.
- TinyXml—efficient platform-independent XML library for C++.
- W3.org on DOM
- Technology Reports
- What does your user agent claim to support?
- W3C DOM scripts and compatibility tables (Quirksmode)
- Gecko DOM Reference (Mozilla Developer Center)
- DOM Reference (Tellme)
- XJR with DOM, SAX2, and XPath interfaces
- Firefox plugin that lets you visualize a Web's page DOM in 3D
World Wide Web Consortium Products and
standardsCanonical XML · CDF · CSS · DOM · Geolocation API · HTML · ITS · MathML · OWL · P3P · PLS · RDF · RDF Schema · SISR · SKOS · SMIL · SOAP · SRGS · SSML · SVG · SPARQL · Timed Text · VoiceXML · WSDL · XForms · XHTML · XHTML+RDFa · XInclude · XLink · XML · XML Base · XML Encryption · XML Events · XML Information Set · XML namespace · XML Schema · XML Signature · XPath 1.0, 2.0 · XPointer · XProc · XQuery · XSL · XSL-FO · XSLT (elements)NotesWorking DraftsGuidelinesInitiativeDeprecated
Organizations Software Conference-related
Wikimedia Foundation. 2010.