Interview Question

Difference between DOM and BOM?

DOM describes the document tree; BOM informally refers to browser environment APIs.

💡 Concept ✅ Quick Revision 🌐 HTML

Answer

The DOM is the standardized object model for a document; “BOM” is an informal name for browser-provided objects around the document. • DOM APIs include `document`, elements, attributes, and events. • Browser environment objects include `window`, `location`, `history`, and `navigator`. • BOM is not one single formal web standard, so interview answers should name the specific browser API.

💡 Simple Example

<script>document.title = window.location.hostname;</script>

⚡ Quick Revision

DOM describes the document tree; BOM informally refers to browser environment APIs.