I have an input which changes value when a click a button. What I want to do is to force an enter keypress event with jQuery. without pressing the button. Is this possible?
Thanks
jQuerys .trigger() should do the trick:
$('input').trigger({
type: 'keypress',
which: 13
});
Ref.: .trigger()
$(element).keydown(function(event) {
if (event.keyCode == '13') {
event.preventDefault();
}
do_something();
});