I am trying to execute some code of js when user press key “enter” or “tab”. When I alert keycode then showing correct, but when press key “enter or tab” then not showing any response.
I tried following code.
<input id="to" onkeypress="checkemail(event);">
function checkemail(evt)
{
var keycode = evt.keyCode? evt.keyCode : evt.charCode;
//alert(keycode);
if(keycode=='13'|| keycode=='9')
{
//MyCode
}
}
This code is work properly in FireFox, but not showing any result in Google Chrome.
Please tell me any solution if have.
Thanks in advance.
it works in chrome 🙂