JavaScript鼠标移开事...LOGIN

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>
提交重置代码
章节课件