반응형
<html>
<head><title>Keyboard Event</title>
<meta name="author" content="moyamoya">
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<style type="text/css">
<!--
td {font-family:'굴림체'; font-size:10pt;}
-->
</style>
<script language="JavaScript">
<!--
function getKey(keyStroke) {
isNetscape=(document.layers);
eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;
which = String.fromCharCode(eventChooser).toLowerCase();
alert(which);
}
document.onkeypress = getKey;
// -->
</script>
</head>
<body>
키보드 이벤트... <br>
아무키나 눌러 보세요.
</body>
</html>