<html> <head> <script type="text/javascript"> function whichType(event){ alert(event.type) } </script> </head> <body onmousedown="whichType(event)"> <p>Click on the document. </p> </body> </html>