innerHTML Property
The innerHTML property sets or returns the HTML content (inner HTML) of an element.
Syntax
Return the innerHTML property:
HTMLElementObject.innerHTML
Set the innerHTML property:
HTMLElementObject.innerHTML = text
Example: 1
Change the HTML content of the element with id=”demo”;
Example: 2
Get the HTML content of the element with id=”myP”
Example: 3
Delete the HTML content of an element.