how to detect key was pressed or not in jquery code example
Example: check if enter key is pressed jquery
$(document).on('keypress',function(e) {
if(e.which == 13) {
alert('You pressed enter!');
}
});
$(document).on('keypress',function(e) {
if(e.which == 13) {
alert('You pressed enter!');
}
});