The most common way to access an HTML element is to use the id of the element.
The “innerHTML” property is useful for getting or replacing the content of HTML elements.
Example:-
<html>
<body>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = "Hello World!";
document.getElementById("demo").style.backgroundColor = "red";
</script>
</body>
</html>