Click here to Skip to main content
13,351,225 members (44,045 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


1 bookmarked
Posted 23 Nov 2011

Find the key code using javascript

, 23 Nov 2011
Rate this:
Please Sign up or sign in to vote.
In Text box key press event, find the pressed key code value using javascript
<input type="text" id="txtSearch"  önkeypress="searchKeyPress(event);" />

function searchKeyPress(e)         
        // look for window.event in case event isn't passed in
        if (window.event) { e = window.event; }
        if (e.keyCode == 13) {
           alert('Enter key pressed on the Text Box control'); 


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Ramanujam Shankar
Web Developer Mahindra Logisoft Business Solution Limited, Chenn
India India
No Biography provided

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.180111.1 | Last Updated 23 Nov 2011
Article Copyright 2011 by Ramanujam Shankar
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid