All document.xxxx methods are part of the DOM, not part of the Javascript language. This is a separate API that belongs to the browser, but access to which Javascript is allowed in the browser.
If a different language was implemented in the browser, it will use the same API to access the DOM. In fact, VBScript in IE does just that - for proof, see the sample code here . (but note, I do not recommend using VBScript in the browser! Stick with JS)
And Javascript can be used outside the browser environment (for example, node.js), in which case it may not have or does not need the structure of the DOM class.
The DOM can also be implemented outside the browser, and the same API will be available for any languages โโthat use it. For example, PHP has a DOMDocument class that implements all the same DOM methods to add / remove / etc elements from a tree.
source share