DOM - Changing the content of the html

It is possible to change the content of an HTML page dynamically using the DOM. Take a look at the following example

<!DOCTYPE html>
************************************ DOM Tutorial 

function addText()
document.getElementById("addtxt").innerHTML="New text";

<p>Click the button and it will add some text.</p>
<button onclick="addText()">Hit me</button>
<p id="addtxt">some text</p>


When the button is clicked the contents of the paragraph is changed.
You may like to try this example here.