What is DOM and where and how to use?

What is DOM and where and how to use?

The browser transforms your html tags in objects that can be used by Javascript.

"When a web page is loaded, the browser creates a Document Object Model (DOM) of the page.

With the object model, JavaScript is fully enabled to create dynamic HTML:

JavaScript can add, change, and remove all the HTML elements and attributes in the page.
JavaScript can change all the CSS styles in the page.
JavaScript can react to all existing events in the page.
JavaScript can create new events in the page." (Wikipedia)

Read more here: https://www.w3schools.com/js/js_htmldom.asp

2 Likes
3 Likes