jQuery - press enter to search with keypress()

0 votes
339 views
added Jun 28, 2022 in jQuery by lcjr First Warrant Officer (11,930 points)
HTML
<input type="text" id="PressSearch" />

 

$('#PressSearch').keypress(function(e){
  if(e.which == 13){//Enter keypad
    alert('Press enter keypad to search....');
  }
});

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...