MouseDown event and mouseUp event
As you know, the combination of a mouseDown event and a mouseUp event is a click event. However, if you press the mouse over the link and move it out of the link to open the mouse, only the mouseD
Own event. These two events can increase the image effect of the icon button,
As for the attributes of mouseDown and mouseUp, they occur along with the Click event, which is the same mechanism as the keyDown event and keyUp event combination.
The three mouse events also have the modifier attribute.
(Note: If the return statement is used in onClick event processing, it can receive any value. The browser can complete the submission as long as the value is not False. However, if you browse
Is False, the form submission operation will be canceled .)
Click Event and dbClick event
OnClick is a click event, while onDblClick is a double-click event. In fact, it is difficult to distinguish between a continuous click and a double-click event. They interfere with each other. In addition, in ie and other browsers
Different. Some browsers trigger the click event every time a double-click event is clicked. in ie, only the first click of the double-click event triggers the click event. Click
Parts are not automatically canceled or ignored. Therefore, if you want to trigger two completely different processes by clicking or double-clicking a link, you must program the double-click action to know
Click.
Example:
<Script>
Var timer = null;
Document. onclick = new Function ("timer = setTimeout (click, 500 )")
Document. ondblclick = new Function ("clearTimeout (timer); dblclick ()")
Function click (){
Alert ("click ")
}
Function dblclick (){
Alert ("dblclick ")
}
</Script>
In a high-version browser, the linked Event Handlers both monitor the special actions that make the script block the link.
For example, to confirm certain data items before you want to navigate to another page, if some fields are incorrect, you can remind and terminate the link. To implement this validation, you must
The last statement of the event handler or the event handler itself returns True or False. If False is returned, the link is terminated.