HTML and CSS Reference
In-Depth Information
EXPLANATION
1
Unless the browser is Microsoft Internet Explorer, a reference to the
event
object
is passed as a parameter called
e
. Internet Explorer uses the
event
property of the
window object to get the value of
e
.
2
If not Internet Explorer, the
which
property contains a value representing the
mouse button.
3
If Internet Explorer, the button property contains that value.
4
The
switch
statement is used to determine which button was clicked. See Figures
13.38 and 13.39.
Figure 13.38
The
left mouse button
was clicked in the green box (Internet Explorer). The
value was 1.
Figure 13.39
The
right mouse button
was clicked in the green box (Internet Explorer). The
value was 2.