Answers for "jquery input submit enter key"

3

jquery on enter key pressed

//jQuery detect user pressing enter
$(document).on('keypress',function(e) {
    if(e.which == 13) {
        alert('User pressed Enter!');
    }
});
Posted by: Guest on July-31-2019
1

jquery submit form on enter

//jQuery submit form when Enter key is pressed
$("#myInputID").keypress(function (e) {
  if (e.which == 13) { 
    $("#myFormID").submit();
     return false; 
  }
});
Posted by: Guest on August-02-2019

Code answers related to "jquery input submit enter key"

Code answers related to "Javascript"

Browse Popular Code Answers by Language