If there is an HTML element with id="hello123", then this JS code prints the content of the element: console.log(hello123.innterHTML)
console.log(hello123.innerHTML);
<p id="hello123">hello this works 123</p>
I discovered this by happenstance, I would other wise have written:
hello123 = document.getElementById("hello123);
console.log(hello123.innerHTML);
What is the difference between the two? Is using getElementById better because it protects be in the case that hello123 is a variable already defined elsewhere that has nothing to do with an HTML element called hello123?