04-04-2023, 07:23 AM
The HTML part between the <body></body> tags looks like this:
The JavaScript part looks like this:
Code:
<!-- Select elements by ID -->
<h1 id="message">JavaScript getElementById() Demo</h1>
The JavaScript part looks like this:
Code:
// Select elements by ID
document.getElementById("message").innerHTML = "Demo";