title: I want the value of my button to appear in a textbox upon clicking the button
body: <p>I am creating an onscreen keyboard, and want a function which will allow when any of the buttons are pressed, for their values to appear in a text box to the side of the keyboard. The code I have so far is:- </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function onclick(){
      document.getElementById("output").value
      =document.getElementById("Q").value;  
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>And the HTML code below:- </p>
  
  <pre><code>&lt;div class ="Row"&gt;
      &lt;div class="Box2"&gt;
        &lt;form id="keyboard" name="keyboard"&gt;
          &lt;div&gt;
          &lt;input type="button" onclick='onclick' id="Q" value="Q"&gt;
          &lt;input type="button" value="W"&gt;
          &lt;input type="button" value="E"&gt;
          &lt;input type="button" value="R"&gt;
          &lt;input type="button" value="T"&gt;
          &lt;input type="button" value="Y"&gt;
          &lt;input type="button" value="U"&gt;
          &lt;input type="button" value="I"&gt;
          &lt;input type="button" value="O"&gt;
          &lt;input type="button" value="P"&gt;
          &lt;/div&gt;
          &lt;div&gt;
          &lt;input type="button" value="A"&gt;
          &lt;input type="button" value="S"&gt;
          &lt;input type="button" value="D"&gt;
          &lt;input type="button" value="F"&gt;
          &lt;input type="button" value="G"&gt;
          &lt;input type="button" value="H"&gt;
          &lt;input type="button" value="J"&gt;
          &lt;input type="button" value="K"&gt;
          &lt;input type="button" value="L"&gt;
          &lt;/div&gt;
          &lt;div&gt;
          &lt;input type="button" value="Z"&gt;
          &lt;input type="button" value="X"&gt;
          &lt;input type="button" value="C"&gt;
          &lt;input type="button" value="V"&gt;
          &lt;input type="button" value="B"&gt;
          &lt;input type="button" value="N"&gt;
          &lt;input type="button" value="M"&gt;
          &lt;/div&gt;
          &lt;div&gt;
          &lt;input type="button" value="SPACE"&gt;
          &lt;input type="button" value="ENTER"&gt;
          &lt;/div&gt; 
        &lt;/form&gt;
        &lt;input type='text' id='output' /&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>