开发者

Call a function in javascript on all onclick events

I want to call a function in javascript. I want to call this function on click of every events or at least on click of all the onclick events in the doc开发者_运维知识库ument.

Please let me know how to do this.


<html>
    <head>
        <script type="text/javascript" language="JavaScript">
        <!--

        document.onclick = myClickHandler;


        function myClickHandler() {
          alert("The document was clicked!");
        }
        -->
        </script>
     </head>
     <body>
         click anywhere within this document.
         <a href="x.html">this will fire the handler too!</a>
     </body>
   </html>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜