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 couldn't get any of they to work. (I don't want to rely on jQuery of other libraries).
Here is what I have so far:
<form>
<input type="text" id="txtfld" />
<input type="button" onclick="typeKey()" />
</form>
<script>
function typeKey(){
var txtField = document.getElementById('txtfld');
var evt= document.createEventObject();
evt.keyCode=68;
txtField.fireEvent('onkeypress', evt);
}
</script>
It does not work, and it does not give an error either.