Javascript examples for DOM:Event
Check event function parameter
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){// w ww. j a v a 2 s . c o m window.callFn = function(evt, type) { if (type === 'child') { console.log(type); } } } </script> </head> <body> <button id="parent" onclick="callFn(event, 'parent')"> <span id="child" onclick="callFn(event, 'child')">Authenticate</span> </button> </body> </html>