国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

JavaScript滑鼠點(diǎn)選事件(onclick)

onclick是滑鼠點(diǎn)擊事件,當(dāng)在網(wǎng)頁上按一下滑鼠時,就會發(fā)生該事件。同時onclick事件呼叫的程式塊就會被執(zhí)行,通常會與按鈕一起使用。

來看個範(fàn)例

<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>php.cn</title>
        <script>
            function fun1(){
                window.alert("歡迎來到php.cn")
            } 
            function fun2(){
                window.alert("你看,你還是點(diǎn)了我")
            }
        </script>
    </head>
    <body>
        <form>
            <input name="點(diǎn)我看看" type="button" value="點(diǎn)我看看" onclick="fun1()"/>
            <p onclick="fun2()">不要點(diǎn)我</p>
        </form>
    </body>
</html>

大家可以嘗試在其它標(biāo)籤上加上onclick事件

#
繼續(xù)學(xué)習(xí)
||
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>php.cn</title> <script> function fun1(){ window.alert("歡迎來到php.cn") } function fun2(){ window.alert("你看,你還是點(diǎn)了我") } </script> </head> <body> <form> <input name="點(diǎn)我看看" type="button" value="點(diǎn)我看看" onclick="fun1()"/> <p onclick="fun2()">不要點(diǎn)我</p> </form> </body> </html>
提交重置程式碼