is clicked. "event.button" will return "1" if right mouse button is
clicked .
In the same way,"event.button" will return "2" if left mouse button is clicked .
File : Mouse_Click_JS.html
<html>
<head>
<script type="text/javascript">
function whichButton(event)
{
if (event.button==2)
  {
  alert("You clicked the right mouse button!");
  }
else
  {
  alert("You clicked the left mouse button!");
  }
}
</script>
</head>
<body onmousedown="whichButton(event)">
<p>Click in the document. An alert box will alert which mouse button
you clicked.</p>
</body>
</html> 	
=========================
Saalram
        Publicize yourself ...
http://saalram.com        ( Free ! )
=========================
 
 

 
 
No comments:
Post a Comment
Saalram.com