I am using this code snippet to add KeyDown event handler to any element in the html form
for(var i=0;i
It is keyCode, not KeyCode.
keyCode
KeyCode