Home >Web Front-end >HTML Tutorial >Detailed introduction to the basic knowledge of html event attributes
Introduction to event attributes:
One of the new features of HTML 4 is that HTML events can trigger actions in the browser. For example, when a user clicks on an HTML element, a section of JavaScript## is started. #.
There are a large number of The value of an event handler is one or a series of Javascript expressions, methods, and function calls separated by semicolons and enclosed in quotes. When the event occurs, the browser executes these codes. For example, when you move your mouse over a hyperlink, a JavaScript function is launched. Browsers that support JavaScript support a special "mouse over" event handler in the tag - calledonmouseover to do the job:
##onabort Script Execute script when image loading is interrupted
Keyboard Events
Invalid in the following elements: base, bdo, br, frame, frameset, head, html, iframe, meta, param, script, style and title elements.
Attribute
onkeydown Script # #onkeyup Script Execute the script when the keyboard is released
Mouse Events
Invalid in the following elements: base, bdo, br, frame, frameset, head, html, iframe , meta, param, script, style and title elements.
Attributes Values Description
onclick Script Execute the script when the mouse is clicked
ondblclick Script Execute the script when the mouse is double-clicked
onmousedownScript Execute the script when the mouse button is pressed
onmousemoveScript Execute the script when the mouse pointer moves
onmouseoutScript When the mouse Execute the script when the pointer moves out of an element onmouseover Script Execute the script when the mouse pointer hovers over an element
onmouseup Script Execute the script when the mouse button is released
The above is the detailed content of Detailed introduction to the basic knowledge of html event attributes. For more information, please follow other related articles on the PHP Chinese website!