Hi all. Here is a little sample code:
It does not work in Firefox. How to make it work?Code:<html> <head> <script type="text/javascript"> function BodyClick() { // How to access the event object here? alert(window.event.shiftKey); } function WindowLoad() { document.body.onclick = BodyClick; } window.onload = WindowLoad; </script> </head> <body></body> </html>
My only requirement is that I need to assign the BodyClick() handler
dynamically in script (not statically in HTML). So I cannot use this solution:
<body onclick="BodyClick(event)">



Reply With Quote
Bookmarks