<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>Down Cursor Key Capture</title>
<script type="text/javascript">
<!--
this.focus();
// capture the DOM key events for the three different DOMs (IE,NS 4,DOM2)
// DOM 2 (modern browsers)
if (document.addEventListener)
document.addEventListener("keypress",checkKey,true);
// NS 4 (proprietary)
if (navigator.appName == "Netscape" && navigator.appVersion.indexOf("4.x") != -1)
document.captureEvents(Event.KEYPRESS);
// (IE proprietary)
document.onkeyup=checkKey;
// the function called on the DOM key events
function checkKey(e) {
// get the key code - 40 is the down cursor arrow
var tmp = (window.event) ? event.keyCode : e.keyCode;
if (tmp==40)
alert('Down Cursor Key Pressed');
}
//-->
</script>
</head>
<body>
Press the down cursor key.
</body>
</html>
Date Validation Using JavaScript .
Cross-Browser Clipboard Copy .
Loading Images With Remote Scripting .
Why JavaScript In Hyperlinks Is Bad .
Change The Submit Button To Show Waiting For AJAX Response .
European Date Validation Using JavaScript .
Database Results To Client Side Array .
Reading Files With JavaScript .
AJAX For Plain Text And HTML .