xxxxxxxxxx
$(document).on('keypress', (e) => {
if(e.keyCode === 13)
alert('enter clicked')
})
xxxxxxxxxx
//jQuery detect user pressing enter
$(document).on('keypress',function(e) {
if(e.which == 13) {
alert('User pressed Enter!');
}
});
jquery on enter keypress
xxxxxxxxxx
// Lets pressing Enter be interpreted as a click
$('.thingy').keypress(function(event) {
if (event.key === "Enter") {
event.preventDefault();
this.click();
}