The Document Object Model (DOM)

The Document Object Model (DOM) is the browser’s internal representation of your webpage’s HTML structure. Every HTML tag (like div, p, img, or even text nodes) becomes a DOM node, forming a tree-like structure. The browser uses this tree to render the page, apply styles, handle events, and respond to user interactions.