Document get element by id innerhtml

Example

Get the HTML content of an element with id="myP":

let html = document.getElementById("myP").innerHTML;

Try it Yourself »

Change the HTML content of an element with id="demo":

document.getElementById("demo").innerHTML = "I have changed!";

Try it Yourself »

Get the HTML content of a