how to detect a key was pressed or not in jquary 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!');
}
});