How to get enter key on keypress event in jquery
08 May 2014, 06:24 AM
Get the pressed key code form event.which
and compare it with the Enter key code that is 13.
$( "#target" ).keypress(function( event ) { if ( event.which == 13 ) { alert('Enter key is pressed.'); } });