How do I trigger the same JQuery function when either:
- the form submit button is clicked
- enter is pressed
How do I trigger the same JQuery function when either:
You can use the keycode for this.
var keycheck = (e.keyCode ? e.keyCode : e.which);
if(keycheck == 13) { // keycode for Enter key
//Do something
}