title: How to type on an input box via JavaScript for IE
body: <p>Trying to figure out how to type (via events not set the value) on an input box for IE8 and 9. I looked at some of the examples on the web - but couldnt get any of they to work. (I don't want to rely on JQuery of other libraries)</p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>&lt;form&gt;
    &lt;input type="text" id="txtfld" /&gt; 
    &lt;input type="button" onclick="typeKey()" /&gt; 
  &lt;/form&gt;
  &lt;script&gt;
  
  function typeKey(){
      var  txtField = document.getElementById('txtfld');
      var evt= document.createEventObject();
      evt.keyCode=68;
      txtField.fireEvent('onkeypress', evt);
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>It does not work, and it does not give an error either.</p>