亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

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("你看,你還是點(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>

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("你看,你還是點(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>
submitReset Code