About the Document Object Model

  • Revision slug: DOM/About_the_Document_Object_Model
  • Revision title: About the Document Object Model
  • Revision id: 358535
  • Created:
  • Creator: achronop
  • Is current revision? No
  • Comment

Revision Content

What is the DOM?

The Document Object Model is an API for HTML and XML documents. It provides a structural representation of the document, enabling you to modify its content and visual presentation. Essentially, it connects web pages to scripts or programming languages.

All of the properties, methods, and events available to the web developer for manipulating and creating web pages are organized into objects (e.g., the document object that represents the document itself, the table object that represents a HTML table elements, and so forth). Those objects are accessible via scripting languages in most recent web browsers.

The DOM is most often used in conjunction with JavaScript. That is, the code is written in JavaScript, but it uses the DOM to access the web page and its elements. However, the DOM was designed to be independent of any particular programming language, making the structural representation of the document available from a single, consistent API. Though we focus on JavaScript throughout this site, implementations of the DOM can be built for any language.

The World Wide Web Consortium establishes a standard for the DOM, called the W3C DOM. It should, now that the most important browsers correctly implement it, enable powerful cross-browser applications.

Why is the DOM support in Mozilla important?

"Dynamic HTML" (DHTML) is a term used by some vendors to describe the combination of HTML, style sheets and scripts that allows documents to be animated. The W3C DOM Working Group is working hard to make sure interoperable and language-neutral solutions are agreed upon (see also the W3C FAQ). As Mozilla claims the title of "Web Application Platform", support for the DOM is one of the most requested features, and a necessary one if Mozilla wants to be a viable alternative to the other browsers.

Even more important is the fact that the user interface of Mozilla (also Firefox and Thunderbird) is built using XUL -- an XML User interface Language. So Mozilla uses the DOM to manipulate its own UI.

 

{{ languages( { "es": "es/Acerca_del_Modelo_de_Objetos_del_Documento", "fr": "fr/\u00c0_propos_du_Document_Object_Model", "ja": "ja/About_the_Document_Object_Model", "ko": "ko/About_the_Document_Object_Model", "pl": "pl/O_modelu_obiektowym_dokumentu", "ru": "ru/\u041e\u0431_\u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0439_\u043c\u043e\u0434\u0435\u043b\u0438_\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430", "zh-cn": "cn/About_the_Document_Object_Model" } ) }}

Revision Source

<h3 id="What_is_the_DOM.3F" name="What_is_the_DOM.3F">What is the DOM?</h3>
<p>The <a href="/docs/DOM">Document Object Model</a> is an API for <a href="en/HTML">HTML</a> and <a href="en/XML">XML</a> documents. It provides a structural representation of the document, enabling you to modify its content and visual presentation. Essentially, it connects web pages to scripts or programming languages.</p>
<p>All of the properties, methods, and events available to the web developer for manipulating and creating web pages are organized into <a href="en/Gecko_DOM_Reference">objects</a> (e.g., the document object that represents the document itself, the table object that represents a HTML table elements, and so forth). Those objects are accessible via scripting languages in most recent web browsers.</p>
<p>The DOM is most often used in conjunction with <a href="en/JavaScript">JavaScript</a>. That is, the code is written in JavaScript, but it uses the DOM to access the web page and its elements. However, the DOM was designed to be independent of any particular programming language, making the structural representation of the document available from a single, consistent API. Though we focus on JavaScript throughout this site, implementations of the DOM can be built for <a class="external" href="http://www.w3.org/DOM/Bindings">any language</a>.</p>
<p>The <a class="external" href="http://www.w3.org/">World Wide Web Consortium</a> establishes a <a class="external" href="http://www.w3.org/DOM/">standard for the DOM</a>, called the W3C DOM. It should, now that the most important browsers correctly implement it, enable powerful cross-browser applications.</p>
<h3 id="Why_is_the_DOM_support_in_Mozilla_important.3F" name="Why_is_the_DOM_support_in_Mozilla_important.3F">Why is the DOM support in Mozilla important?</h3>
<p>"Dynamic HTML" (<a href="en/DHTML">DHTML</a>) is a term used by some vendors to describe the combination of HTML, style sheets and scripts that allows documents to be animated. The W3C DOM Working Group is working hard to make sure interoperable and language-neutral solutions are agreed upon (see also the <a class="external" href="http://www.w3.org/DOM/faq.html">W3C FAQ</a>). As Mozilla claims the title of "Web Application Platform", support for the DOM is one of the most requested features, and a necessary one if Mozilla wants to be a viable alternative to the other browsers.</p>
<p>Even more important is the fact that the user interface of Mozilla (also Firefox and Thunderbird) is built using XUL -- an XML User interface Language. So Mozilla uses the DOM to <a href="en/Dynamically_modifying_XUL-based_user_interface">manipulate its own UI</a>.</p>
<div class="noinclude">
  &nbsp;</div>
<p>{{ languages( { "es": "es/Acerca_del_Modelo_de_Objetos_del_Documento", "fr": "fr/\u00c0_propos_du_Document_Object_Model", "ja": "ja/About_the_Document_Object_Model", "ko": "ko/About_the_Document_Object_Model", "pl": "pl/O_modelu_obiektowym_dokumentu", "ru": "ru/\u041e\u0431_\u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0439_\u043c\u043e\u0434\u0435\u043b\u0438_\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430", "zh-cn": "cn/About_the_Document_Object_Model" } ) }}</p>
Revert to this revision