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
||
<!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>
  • Cadangan kursus
  • Muat turun perisian kursus