Coding

JavaScript Can Change HTML Content – JavaScript Tutorial

Method Name

getElementById().

Method Definition

This example used the method to "find" the HTML element (with id="demo") and changes the element content (innerHTML) to "Hello My JavaScript":

Example

document.getElementById("demo").innerHTML = "Hello My JavaScript";
Try It Yourself - Online Compliler >>