App下载
实例代码( Tip: 登录后体验更佳 )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>W3Cschool(w3cschool.cn)</title>
</head>
<body>
<p>使 HTML DOM input "oninput" </p>
<p></p>
: <input type="text" id="myInput" value="Mickey">
<script>
document.getElementById("myInput").oninput = function() {myFunction()};
function myFunction() {
alert("input ");
}
</script>
</body>
</html>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
运行结果