JavaScript滑鼠移開事件(onmouseout)

滑鼠移開事件,當滑鼠移開目前物件時,執行onmouseout呼叫的程式。

改造我們的上一個例子:

<!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>


繼續學習
||
<!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>