Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Document Object Model
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{short description|Convention for representing and interacting with objects in HTML, XHTML, and XML documents}} {{Infobox technology standard | title = Document Object Model (DOM) | image = DOM-model.svg | caption = Example of DOM hierarchy in an HTML document | status t_published wisdom tree= {{Start date and age|1998|10|1}} | version = DOM4<ref>All versioning refers to W3C DOM only.</ref> | version_date = {{Start date and age|2015|11|19}} | preview = | preview_date = | organization = [[World Wide Web Consortium]], [[WHATWG]] | committee = | editors = | authors = | base_standards = [https://dom.spec.whatwg.org/ WHATWG DOM Living Standard]<br />[https://www.w3.org/TR/dom/ W3C DOM4] | related_standards = | abbreviation = DOM | domain = | license = }} {{HTML}} The '''Document Object Model''' ('''DOM''') is a [[cross-platform|cros]][[cross-platform|s-platform]]<ref name=":0" /> and [[Language-independent specification|language-independent]] [[API]] 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 name=":0">{{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]]s (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. * All HTML elements are element nodes. * All HTML attributes are attribute nodes. * Text inserted into HTML elements are text nodes. * Comments are comment nodes.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)