Tuesday, March 18, 2008

Capture Mouse Click Event


<html>
<head>
<title>Capture Mouse Click Event</title>
<script language="javascript">
function noLeftClick()
{
switch (event.button)
{
case 1:
alert('You Clicked Left-Click ');
break;
case 2:
alert('You Clicked Right-Click.');
break;
}
}
document.onmousedown=noLeftClick
</script>
</head>
<body>
<h5>Click Any Were Within Browser</h3>
</body>
</html>
Program Demo

Note:IE Supported

No comments: