innerHTML

The innerHTML method can be used to change the content of an element such as a paragraph.

For example, to change the content of a paragraph with the ID of “message”, you could use the code:

document.getElementById("message").innerHTML = "This is your new message!";