Acara pergerakan tetikus JavaScript (onmouseout)

Acara pergerakan tetikus, apabila tetikus bergerak menjauhi objek semasa, atur cara yang dipanggil onmouseout dilaksanakan.

Ubah contoh terakhir kami:

<!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="提交之后移开鼠标"  onmouseout="fun()"/>
        </form>
    </body>
</html>


Meneruskan pembelajaran
||
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="" onmouseout="fun()"/>
</form>
</body>
</html>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
图片放大关闭