Javascript examples for DOM Event:onclick
Find out what function is being called by an object's onclick event
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*w w w.j a va 2s. c om*/ div1 = document.getElementById('div1'); console.log(div1.getAttribute("onclick")); } </script> </head> <body> <div id="div1" onclick="myfun();"> </div> </body> </html>