title: display text in text field using javascript for multiple characters
body: <p>I would like to use JavaScript to display text in an input text field using JavaScript. I can achieve this using individual lines of code for each character(9, 10, e...), but I can't consolidate this into one line of code which I know is possible. When I try consolidating, nothing shows up in the text area or it will just flash, but doesn't stay on the screen.</p>
  
  <p>Here's my working code which works great, but I don't want to type this code for every character I want.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;form name="frm"&gt;
    &lt;input type="text" name="result"&gt;
    &lt;input type="button" name="3" value="7" onClick="run7()"&gt;
    &lt;input type="button" name="4" value="8" onClick="run8()"&gt;
    &lt;input type="button" name="3" value="9" onClick="run9()"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>function run7(){
  document.frm.result.value += "7";
  }
  function run8(){
  document.frm.result.value += "8";
  }
  function run9(){
  document.frm.result.value += "9";
  </code></pre>
  
  <p>Here's a list of things I triedI tried but did not work:</p>
  
  <pre><code>var character = document.getElementById('id').value;
  document.frm.result.value = character;
  </code></pre>
  
  <p>I even changed the inputs to buttons</p>
  
  <pre><code>var character = document.getElementById('id').innerHTML;
  document.frm.result.value = character;
  
  var character = document.getElementById('id').innerHTML.value;
  document.frm.result.value = character;
  
  var character = document.getElementById('id').value.innerHTML;
  document.frm.result.value = character;
  
  var textField = document.frm.result;
  function runEverything() {
   textField.onclick(function) {
     textField = document.getElementById('id').innerHTML;
   }
  }
  </code></pre>
  
  <p>Of course I'm still a virgin to Javascript. But seriously, what I'm I missing here?</p>