What the best way to simulate the user pressing "enter"? $(element).keypress() doesn't seem to allow me to pass in the actual key that was pressed.
This is for unit testing.
Demo Here
var e = jQuery.Event("keypress"); e.which = 13; //choose the one you want e.keyCode = 13; $("#theInputToTest").trigger(e);
1.4m articles
1.4m replys
5 comments
56.9k users