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.Įven if most web developers will only use the DOM through JavaScript, implementations of the DOM can be built for any language, as this Python example demonstrates: JavaScript can also be used in other contexts.įor example, Node.js runs JavaScript programs on a computer,Īnd the DOM API is not a core part of the Node.js runtime. The DOM is not part of the JavaScript language,īut is instead a Web API used to build websites. They can all be accessed and manipulated using the DOM and a scripting language like JavaScript. The document as a whole, the head, tables within the document, table headers, text within the table cells, and all other elements in a document are parts of the document object model for that document. The DOM is not a programming language, but without it, the JavaScript language wouldn't have any model or notion of web pages, HTML documents, SVG documents, and their component parts. That is to say, it is written in JavaScript, but uses the DOM to access the document and its elements. The previous short example, like nearly all examples, is JavaScript.