Talk:Document Object Model: Difference between revisions

Content deleted Content added
Line 113:
<blockquote>The DOM is a representation of the tree of elements in a page. These elements are what '''the''' [[HTML tags]] '''represent''' in an HTML document. When a [[web browser]] reads the markup (HTML, XHTML, etc) in a [[webpage]] it builds '''an [[Object (computer science)|object]] [[Domain model|model]] of the document, a''' DOM for the page, usually in memory from its tag structure. As an example of how the DOM is distinct from the HTML it is based on, the elements of a DOM may not correspond one-to-one to the tags in a page. This '''may be''' due to irregularities such as [[Tag soup|invalid HTML]] and omitted [[Tag omission|optional tags]]. In the former case, web browsers attempt to build a DOM out of ambiguous markup. In the latter case, a browser '''may''' add elements to the DOM which were not represented by tags. The DOM that the browser constructs is what it then uses to render the page for display to the user.</blockquote>
<blockquote>'''The DOM of a webpage needs to be distinguished''' from its markup because of [[client-side scripting]] (usually [[JavaScript]]). The initial DOM constructed from the markup can serve as the target of scripts. The elements of the DOM '''can be manipulated''' by JavaScript. After each manipulation, the DOM has been further altered from its initial representation of the markup. At each step, the page is re-rendered to the user.</blockquote>
<blockquote>'''The DOM is also accessed by"""''' [[Cascading Style Sheets]] or CSS. CSS can change the display of a webpage by '''addressing''' elements in its DOM and '''altering''' how they are rendered.</blockquote>
---[[User:Nigelj|Nigelj]] ([[User talk:Nigelj|talk]]) 12:39, 8 December 2011 (UTC)