Navigator 2.0, Internet Explorer 3.0; enhanced in Navigator 3.0
<A onClick="handler-statements"> a definition of the handler <AREA onClick="handler-statements"> another definition; Navigator 3.0 only link.onclick a reference to the handler link.onclick(); an explicit invocation of the handler
The onclick() event handler is invoked before the browser follows the clicked hypertext link. This allows you to set the href, target, and other properties of the link dynamically (using the this keyword to refer to the clicked link). You may also use Window.alert(), Window.confirm(), and Window.prompt() from this event handler.
In Navigator 3.0, you may prevent the browser from following the link by returning false. If you return true, or any other value, or nothing, then the browser will follow the link as soon as onclick() returns. You might stop the browser from following a link if you used the Window.confirm() method to ask the user if they really want to follow the link and they choose the Cancel button, for example. In general, if you want a link that performs some action but does not cause a new URL to be displayed, it is better to use a the onclick() event handler of a Button object instead of the onclick() handler of a Link object.
Note that while this event handler returns false to tell the browser not to perform its default action (following a link), the onmouseover() event handler must return true to tell the browser not to take its default action (displaying the URL of the link). This incompatibility exists for historical reasons. The standard for Form and form element event handlers is to return false to prevent the browser from performing a default action.