I. Overview of event handler functions
The types of events that JavaScript can handle are: mouse events, keyboard events, HTML events.
All event handlers are made up of two parts, the on + event name, such as the event handler for the Click event: OnClick.
For each event, it has its own trigger range and mode, and if the trigger range and mode are exceeded, the event processing will be invalidated.
Second, mouse events: All elements of the page can be triggered
1 . Click: triggers when the user clicks the mouse button or presses the ENTER key.
<script type= "Text/javascript" > function() { var input = document.getElementsByTagName (' input ') [0]; function () { alert (' Lee '); }; } </script>
2. DblClick: Triggered when the user double-clicks the primary mouse button.
<script type= "Text/javascript" > function() { var input = document.getElementsByTagName (' input ') [0]; function () { alert (' Lee '); }; } </script>
3, MouseDown: When the user pressed the mouse has not bounced when the trigger.
<script type= "Text/javascript" > function() { var input = document.getElementsByTagName (' input ') [0]; function () { alert (' Lee '); }; } </script>
4.MouseUp: triggers when the user releases the mouse button.
<script type= "Text/javascript" > function() { var input = document.getElementsByTagName (' input ') [0]; function () { alert (' Lee '); }; } </script>
5,mouseover: triggered when the mouse moves over an element.
<script type= "Text/javascript" > function() { var input = document.getElementsByTagName (' input ') [0]; function () { alert (' Lee '); }; } </script>
6.mouseout: Triggers when the mouse moves out of an element.
<script type= "Text/javascript" > function() { var input = document.getElementsByTagName (' input ') [0]; function () { alert (' Lee '); }; } </script>
7.mousemove: Triggers when the mouse pointer moves over an element (triggered when mouseover is almost moved to an element).
<script type= "Text/javascript" > function() { var input = document.getElementsByTagName (' input ') [0]; function () { alert (' Lee '); }; } </script>
JavaScript Event _ Event handler overview and handling functions for mouse events