title: Javascript onclick event to write different text to an element with each click
body: <p>What Javascript code can I use to write to the HTML DOM? I want to create a button which each time I click it, it writes different text to a document element? Example;</p>
  
  <p>first click:</p>
  
  <pre><code>document.getElementById("paragraph").innerHTML= "This is is the initial text."
  </code></pre>
  
  <p>second click:</p>
  
  <pre><code>document.getElementById("paragraph").innerHTML= "This text replaces the initial text"
  </code></pre>
  
  <p>third click:</p>
  
  <pre><code>document.getElementById("paragraph").innerHTML= "This text replaces the text from the second click"
  </code></pre>
  
  <p>and so forth and so forth...</p>
  
  <p>All without 
  Thanks in advance.</p>