Document Object Model: Difference between revisions

Content deleted Content added
No edit summary
Tags: Reverted references removed Visual edit Mobile edit Mobile web edit
Line 20:
}}
{{HTML}}
The '''Document Object Model''' ('''DOM''') is a [[cross-platform]] and [[Language-independent specification|language-independent]] interface that treats an [[HTML]] or [[XML]] document as a [[tree structure]] wherein each [[Node (computer science)|node]] is an [[Object (computer science)|object]] representing a part of the document. The DOM represents a document with a logical tree. Each branch of the tree ends in a node, and each node contains objects. DOM methods allow programmatic access to the tree; with them one can change the structure, style or content of a document.<ref>{{Cite web |title=Document Object Model (DOM): definition, structure and example |url=https://www.ionos.com/digitalguide/websites/web-development/an-introduction-to-the-document-object-model-dom/ |access-date=2022-04-21 |website=IONOS Digitalguide |language=en}}</ref> Nodes can have [[event handler]]shandlers (also known as event listeners) attached to them. Once an event is triggered, the event handlers get executed.<ref name="Introduction">{{cite web
| access-date = 2012-01-12
| publisher = W3C
| title = Document Object Model (DOM)
| quote = The Document Object Model is a platform- and language-neutral interface that will allow programs and scripts to dynamically access and update the content, structure and style of documents.
| url = http://www.w3.org/DOM/#what}}</ref>
 
The principal standardization of the DOM was handled by the [[World Wide Web Consortium]] (W3C), which last developed a recommendation in 2004. [[WHATWG]] took over the development of the standard, publishing it as a [[living document]]. The W3C now publishes stable snapshots of the WHATWG standard.
 
In HTML DOM (Document Object Model), every element is a node:<ref>{{cite web | url=https://www.w3schools.com/js/js_htmldom.asp | title=JavaScript HTML DOM }}</ref>
 
* A document is a document node.