How can I mimic pressing the enter button from within a <input>
, using jQuery?
In other words, when a <input>
(type text) is in focus and you press enter, a certain event is triggered. How can I trigger that event with jQuery?
There is no form being submitted, so .submit()
won't work
EDIT
Okay, please listen carefully, because my question is being misinterpreted. I do NOT want to trigger events WHEN the enter button is pressed in textbox. I want to simulate the enter button being pressed inside the textbox, and trigger this from jQuery, from $(document).ready
. So no method involving on.('keypress')...
or stuff like that is what I'm looking for.