title: Populate text box in Javascript by clicking on button
body: <p>I am trying to populate a text box on a form by clicking on form buttons.  Below is code I have so far - modified this code from a select box example -</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
      &lt;script&gt;
          function moveNumbers(){
              var no=document.getElementById("no");
              var txt=document.getElementById("result").value;
              txt=txt + option;
              document.getElementById("result").value=txt;
          }
      &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;form&gt;
          Select numbers:&lt;br&gt;
          &lt;input type="button" value="1" name="no" onclick="moveNumbers()"&gt; 
          &lt;input type="button" value="2" name="no" onclick="moveNumbers()"&gt; 
          &lt;input type="button" value="3" name="no" onclick="moveNumbers()"&gt; 
  
          &lt;input type="text" id="result" size="20"&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>