Interview Question

What is DOM?

The DOM is the browser’s editable object tree of the page.

💡 Concept ✅ Quick Revision 🌐 HTML

Answer

The DOM is the browser’s tree-shaped model of an HTML page. • Each HTML element becomes an object in the tree. • JavaScript can read and change these objects. • When the DOM changes, the visible page can change too.

💡 Simple Example

<p>document.querySelector(&#039;h1&#039;).textContent = &#039;Hello&#039;;</p>

⚡ Quick Revision

The DOM is the browser’s editable object tree of the page.