What is the purpose of the Document Object Model (DOM) in JavaScript?
It is used to store and execute JavaScript code.
It is responsible for rendering web pages in web browsers.
It provides a way to interact with and manipulate the elements of an HTML or XML document.
It is used to create dynamic server-side applications.
The Document Object Model (DOM) in JavaScript provides a way to interact with and manipulate the elements of an HTML or XML document. It allows developers to access and modify the content, structure, and styling of a web page by using methods and properties exposed by the DOM API. For example, with the DOM, you can dynamically change the text of an element, add or remove HTML elements, or change the CSS styles of elements on a web page.