This is a code for key press 'A' (65): See: http://jsfiddle.net/3xTM2/466 The problem is: Why 'A' doesn't display after clicking submit?
var onclick = function(){
var e = $.Event('keypress');
e.which = 65; // Character 'A'
$(this).focus().trigger(e);
console.log('pressed');
};
$('#test').click(onclick);
<input id="test" type="input" />
I want to simulate 'a' click key at input form after clicking Submit button. Why 'A' hasn't been typed into 'input form'? How to change this code to display 'a' at input form after simulate it by javascript?