My application requires an input from users, on entering a value in a textbox, users hit Enter (Return Key) and this calls a
buttons onclick event. This works fine in IE, FF but not Chrome. On enter in chrome, keypress event is not generated
Here is my code snippet
$('#myDiv').keypress(function (e) {
alert("Key pressed");
if (e.keyCode == $.ui.keyCode.ENTER) {
alert("enter pressed");
}
});
Could anyone provide input on this?
Cross-browsers method :
Tested on Chrome 24 : http://jsfiddle.net/PTauw/1/