Building Interactive Websites With JavaScript - JavaScript and The DOM Cheatsheet - Codecademy
Building Interactive Websites With JavaScript - JavaScript and The DOM Cheatsheet - Codecademy
HTML DOM
The DOM is an interface between scripting languages and
a web page’s structure. The browser creates a Document
Object Model or DOM for each of the webpage it renders.
The DOM allows scripting languages to access and modify
a web page. With the help of DOM, JavaScript gets the
ability to create dynamic HTML.
<script>
const box = document.querySelector('p');
// Outputs '<p>Hello there!</p>':
console.log(box.innerHTML)
// Reassigns the value:
box.innerHTML = '<p>Goodbye</p>'
</script>