<html>
<head>
<title>Mouse Events Example</title>
<script type="text/javascript">
function handleEvent(oEvent) {
var oTextbox = document.getElementById("txt1");
oTextbox.value += "A button down is " + oEvent.button;
var arrKeys = [];
if (oEvent.shiftKey) { arrKeys.push("Shift"); }
if (oEvent.ctrlKey) { arrKeys.push("Ctrl"); }
if (oEvent.altKey) { arrKeys.push("Alt"); }
if (arrKeys.length > 0) { oTextbox.value += " keys down are " + arrKeys; }
oTextbox.value += "
";
}
</script>
</head>
<body>
<P>Use your mouse to click and double click the red square.</p>
<div style="width: 100px; height: 100px; background-color: red"
onclick="handleEvent(event)"
id="div1"></div>
<P><textarea id="txt1" rows="15" cols="66"></textarea></p>
</body>
</html>