Kích hoạt khi nhấn xuống một phím (bất kỳ phím nào).
Ví dụ
<html>
<head>
<script>
function sayHello() { alert("Phím được nhấn xuống."); }
</script>
</head>
<body>
<input type="text" onkeydown="sayHello()">
</body>
</html>
Kích hoạt khi nhấn xuống một phím (bất kỳ phím nào).
<html>
<head>
<script>
function sayHello() { alert("Phím được nhấn xuống."); }
</script>
</head>
<body>
<input type="text" onkeydown="sayHello()">
</body>
</html>