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>
标签:function,f1,console,log,对象,onkeydown,keyCode,event 来源: https://www.cnblogs.com/startl/p/12254309.html