{"id":247,"slug":"dom","name":"Document Object Model (DOM)","short_description":"DOM is a cross-platform and language-independent interface that treats an HTML or XML document as a tree structure.","url":"https://github.com/topics/dom","github_count":6700,"created_by":"World Wide Web Consortium","logo_url":null,"released":"October 1, 1998","wikipedia_url":"https://en.wikipedia.org/wiki/Document_Object_Model","related_topics":["shadow-dom","virtual-dom","html","xml","dhtml"],"aliases":["dom-tree","dom-node","dom-element","dom-elements"],"github_url":"https://github.com/whatwg/dom","content":"\u003cp\u003e\u003cstrong\u003eDOM\u003c/strong\u003e (short for \u003cstrong\u003eD\u003c/strong\u003eocument \u003cstrong\u003eO\u003c/strong\u003ebject \u003cstrong\u003eM\u003c/strong\u003eodel) is a cross-platform and language-independent interface that treats an HTML or XML document as a tree structure wherein each node is an 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. Nodes can have event handlers (also known as event listeners) attached to them. Once an event is triggered, the event handlers get executed.\u003c/p\u003e\n\n\u003cp\u003eThe 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.\u003c/p\u003e\n\n\u003cp\u003eIn HTML DOM (Document Object Model), every element is a node:\u003c/p\u003e\n\u003cul\u003e\n  \u003cli\u003eA document is a document node.\u003c/li\u003e\n  \u003cli\u003eAll HTML elements are element nodes.\u003c/li\u003e\n  \u003cli\u003eAll HTML attributes are attribute nodes.\u003c/li\u003e\n  \u003cli\u003eText inserted into HTML elements are text nodes.\u003c/li\u003e\n  \u003cli\u003eComments are comment nodes.\u003c/li\u003e\n\u003c/ul\u003e\n","created_at":"2024-07-29T13:37:53.253Z","updated_at":"2026-06-28T00:08:59.016Z","topic_url":"https://awesome.ecosyste.ms/api/v1/topics/dom","html_url":"https://awesome.ecosyste.ms/topics/dom","projects_url":"https://awesome.ecosyste.ms/api/v1/projects?keyword=dom","lists_url":"https://awesome.ecosyste.ms/api/v1/lists?topic=dom"}