Find the key code using javascript





0/5 (0 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');
}
}