I need to invoke javascript event onKeyDown, which should get invoked when we press any key from anywhere of the page. currently I am callin like this:
Is ther any way to invoke it, other than from body. Like the line (//document.onKeyD own=isBack(even t);) . will it work?
Code:
<head>
<script type="text/javascript">
//document.onKeyDown=isBack(event);
function isBack(event)
{
alert('hit a key');
}
</script>
</head>
<body onKeyDown="isBack(event);">
<input type="text" id="myid">
</body>
Comment