4. Frontend: The User's Window/4.4 The Browser's Magic: DOM and DevTools
Conversation from The Software Realm, Decoded
Chapter 4 · 4.4.1 The DOM: Your Live Document · pp. 95–96
Peter
When I do textContent = ’new text’, what’s actually changing?
Senior developer
Great question. Your HTML file is static text on disk. When the browser loads it, it builds a live tree structure in memory: the DOM.
The paradigm shift: - HTML file = static blueprint - DOM = dynamic house you can renovate When you change textContent, you’re changing the DOM, not the HTML file.
Peter
So JavaScript manipulates the DOM, not the file?
Senior developer
Exactly. Understanding this is the moment you stop being a beginner.