HTML and CSS Reference
EXAMPLE 13.9 ( CONTINUED )
A global variable called counter is initialized.
If the user double-clicks the mouse anywhere on the page, an alert dialog box will
appear; if the user clicks OK in the alert dialog box, the window will be closed.
The window 's close method causes the current window to be closed.
This function is called when the onMouseOver event handler is triggered. This
event happens when the user touches the mouse on an object, in this case, a but-
The counter is incremented by one every time the user touches the button.
The onDblClick event handler is an attribute of the HTML <body> tag. When the
user double-clicks the mouse, the alertme() function will be called, and the win-
The onMouseOver event handler is an attribute of the <a href> link tag. It is trig-
gered anytime the user moves the mouse over the link. (The link has been deac-
tivated by using the # sign.) When this event occurs, the alert method is called.
The onMouseOut event handler is an attribute of the <a href> link tag. Any time
the user moves the mouse away from this link, the event is triggered, and the alert
method is called.
The form starts here. The input type is a button.
When the user's mouse touches the button, the onMouseMove event handler is
triggered, and the track_Moves() function is called. This function will simply in-
crement a counter by one each time it is called, and then alert the user.