To check if enter was pressed in jQuery you can use the following snippet.

Sample jQuery

 $('#element').keyup(function(e) {
	if(e.keyCode == 13) {
		alert('Enter was pressed.');
	}
});

2 thought on “How to check if enter was pressed in jQuery”

Leave a Reply