how I can do to fire the keypress
event to an input
element?. The event is triggered but I can not make it run completely, because not write the letter.
I try the same recording the event, but I had the same problem.
<button>fire event</button>
<input id="test" />
<div id="info"></div>
$("#test").on('keypress', function(event){
$('#info').append('<br />intro event: ' + event.keyCode);
});
$('button').on('click', function(event) {
var e = $.Event('keypress', { keyCode: 102 } );
$("#test").trigger( e );
});
Thank you.
Edit
I need is save all events that happen on my page and then able to fire. I have already complete the code to save the events, but my problem is how to fire.