title: Changing div content with Javascript onClick
body: <p>I'm trying to use a textbox and a submit button to change a div on the page. I want to take the text that has been typed in the textbox and put it in the div when the button is clicked. I have this code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function myfunction() { 
      var myText = document.getElementById("textbox").value;
      document.getElementById('myDiv').innerHTML = myText;
   } </code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form&gt;
  &lt;input type="text" name="textbox" id="textbox" /&gt;
  &lt;input type="submit" name="button" id="button" onclick="myfunction()" /&gt;
  &lt;/form&gt;
  &lt;br/&gt;
  &lt;div id="myDiv"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>But nothing happens. When I try it in the browser it just refreshes the page and adds <code>?textbox=someValueHere</code> to the end of the URL. How can I get the div to display the textbox value?</p>