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.');
     }

 });

Related Contents

15 May 2014, 08:07 AM
C#, LINQ, List
15 May 2014, 07:54 AM
C#, LINQ, List
29 Apr 2014, 03:07 AM
C#, Generic
29 Apr 2014, 02:51 AM
C#, Generic
About
expalins how to get enter key code in keypress event in jquery

Date Posted 08 May 2014, 06:19 AM
Author Brainy Solutions
Views 992
;