Browsers come with a set of built-in objects that model data used and operations performed by your applications:
- The Browser Object Model API (BOM) features
Windowobject that models browser's windows and tabs. - The Document Object Model API (DOM) features
Documentobject that models web pages displayed in browser's windows.
The DOM API specification serves two purposes:
- how browser should make a model of HTML documents using objects:
When a browser loads a web page, it creates a structure, a DOM tree, that is a live representation of the web page. The DOM tree is made of Node objects and each node represents an element that is part of the web page. - how JS programs can access this model for changing HTML documents:
JavaScript program can access the DOM tree for modifying the HTML document. This does not change the HTML code, but only the DOM, the representation of the document.
