What is the DOM in JavaScript?

The DOM (Document Object Model) is a tree of objects that the browser creates from the HTML. Each tag becomes a node. JavaScript can use the DOM to read and change the content, style and structure of the page.

document.getElementById("title").textContent = "New title";

See JavaScript HTML DOM.


Learn more about the similar topics:
Tutorials
JavaScript Events
JavaScript HTML DOM
JavaScript DOM Manipulation
JavaScript HTML DOM EventListener
JavaScript Forms and Validation
Exercises & Assignments
Write a JavaScript program to change the text of a paragraph on button click
Write a JavaScript program to switch dark mode on and off
Interview Questions & Answers
What is the DOM in JavaScript?
How do you select elements in the DOM?
What are events and event listeners in JavaScript?
What is event bubbling and capturing in JavaScript?
What is event delegation in JavaScript?