event对象的onkeydown使用

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>onkeydown</title>
</head>
<body>
<input type="button" value="crack" onkeydown="f1(event)">
<input type="button" value="press" onkeypress="f2(event)">
<input type="button" value="crack" onkeydown="f2(event)" onkeyup="f3()">
<script>
// function f1(e) {
// console.log(e.keyCode);
//// alert(e.keyCode);
//
// }
function f2(e) {
console.log(111);

}
function f3(e) {
console.log(555);

}
</script>

</body>
</html>
原文地址:https://www.cnblogs.com/startl/p/12254309.html