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

JavaScript mouse click event (onclick)

onclick is a mouse click event, which occurs when the mouse is clicked on the web page. At the same time, the program block called by the onclick event will be executed, usually used with buttons.

Let’s see an example

<!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("你看,你還是點了我")
            }
        </script>
    </head>
    <body>
        <form>
            <input name="點我看看" type="button" value="點我看看" onclick="fun1()"/>
            <p onclick="fun2()">不要點我</p>
        </form>
    </body>
</html>

You can try adding onclick events to other tags

Continuing Learning
||
<!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("你看,你還是點了我") } </script> </head> <body> <form> <input name="點我看看" type="button" value="點我看看" onclick="fun1()"/> <p onclick="fun2()">不要點我</p> </form> </body> </html>
submitReset Code