how to check whether the key pressed iis enter code example
Example 1: enter event in jquery
$('#textbox').keypress(function(event){
var keycode = (event.keyCode ? event.keyCode : event.which);
if(keycode == '13'){
alert('You pressed a "enter" key in textbox');
}
});
Example 2: how to check if enter is pressed javascript
$('#usersearch').keydown(function(e){
if(e.keyCode === 13){
alert("Enter was pressed ");
}
});