title: Displaying a large string in sentences one click at a time
body: <pre><code>#branchID pool
  branch0 = "This is a wall of text. This is a wall of text. This is a wall of text. This is a wall of text. This is a wall of text. This is a wall of text."
  branch1 = "This is a second wall of text."
  branch2 = "This is a third wall of text."
  
  #classes section
    #pulls text from pools above.
  branch = (name, branchid)-&gt;
    stringID = String(branchid)
    document.write("&lt;h1 id=\'#{stringID}\'&gt;#{name}&lt;/h1&gt;")
    document.getElementById(stringID).onclick = -&gt;
      document.write(branchid)
  
  #This is where the game goes. It will be built with conditionals
  window.onload = -&gt;  
    branch('Start', branch0)
  </code></pre>
  
  <p>I'm creating a browser based "choose your own adventure" game using CoffeeScript. Above is the code I have so far. It creates an HTML element, and when clicked, a string of text is written to the page in one giant block.</p>
  
  <p>My question is, How could I make it so only a sentence at a time is loaded, and then when clicked, the next sentence is loaded, then the next, until there is nothing else left in the string?</p>