title: Using input type="submit" to change content
body: <p>Okay, I'm pretty sure I'm missing something very obvious here, but I just couldn't find a proper solution so far. What I'm trying to do is simple: Have a user write something into a form, have him submit the form, and write that input into a textarea on the same page.</p>
  
  <p>This is my code:</p>
  
  <pre><code>&lt;html&gt;&lt;head&gt;&lt;/head&gt;
  &lt;body&gt;
  &lt;form name='registration'&gt;
  &lt;label for="input"&gt;Input:&lt;/label&gt;
  &lt;input type="text" id="input"/&gt;
  &lt;input type="submit" id="submit" value="Submit" onclick="execute()"/&gt;
  &lt;/form&gt;
  
  &lt;div id="results"&gt;
  &lt;span&gt;Result&lt;/span&gt;
  &lt;span&gt;&lt;textarea cols="30" rows="5" id="resulttext" readonly="readonly"&gt;&lt;/textarea&gt; &lt;/span&gt;
  &lt;/div&gt;
  
  &lt;script&gt;
  function execute()
  {
      var result = document.getElementById("input").value
  
      document.getElementById("resulttext").value=result;
  }
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Now what happens if I enter something into the form is that the textarea briefly shows my input before reverting back to showing nothing. My guess is that the textarea field is only changed for the duration of the execute() function.</p>
  
  <p>When I change <code>input type="submit"</code> to a <code>&lt;button&gt;</code> everything works as intended, but I'm pretty sure I'm not supposed to do that.</p>