xxxxxxxxxx
index.html------------------------------>
//<body>
// <h1 id="page-title">The DOM</h1>
// <div class="content">
// <p>this is the content</p>
// </div>
// <script src="sandbox.js"></script>
//</body>
sandbox.js------------------------------->
//grab the content
const content = document.querySelector('.content');
//change the element...
content.innerHTML = '<h2>This replaces the element</h2>';
//...or append the element
content.innerHTML += '<h2>this appends a new element</h2>'
xxxxxxxxxx
const content=document.querySelector('.content');
content.innerHTML='<h2 style="background:orange; color:blue; font-family:monospace">This is the new Header</h2>';
xxxxxxxxxx
element.innerHTML = "<p>read this</p>" Change the inner HTML of an element
element.style.color = "blue"; Change the style of an HTML element
element.setAttribute(important, "true") Change the attribute value of an HTML element
element.important = "true" Change the attribute value of an HTML element