Get an enter key press event

$("#txtSearch").keypress(function(e) {
    if (e.keyCode == "13") {
        alert("Enter key pressed");
    }
});

Advertisements