JavaScript鼠标经过事件(onmouseover)

鼠标经过事件,当鼠标移到一个对象上时,该对象就触发onmouseover事件,并执行onmouseover事件调用的程序。

实例:当鼠标移动到绑定了onmouseover事件的元素时,弹出对话框

<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>php.cn</title>
        <script>
            function fun(){
                window.alert("请确认四周没有人再点击提交")
            } 
        </script>
    </head>
    <body>
        <form>
            机密:
            <input name="txt" type="text" >
            <input name="" type="button" value="提交" onmouseover="fun()"/>
        </form>
    </body>
</html>


继续学习
||
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>php.cn</title>
<script>
function fun(){
window.alert("")
}
</script>
</head>
<body>
<form>
<input name="txt" type="text" >
<input name="" type="button" value="" onmouseover="fun()"/>
</form>
</body>
</html>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
提交重置代码
图片放大关闭