onmousedown event
The onmousedown event occurs when a user presses the mouse button. The button here is not necessarily the left mouse button, but any button on the mouse. It can usually be inserted in various elements of the web page, such as pictures img , DIV blocks, span areas, paragraphs, or even directly written in the <body> tag, used to determine whether users can use the mouse to click on certain specific elements, and then trigger specific JavaScript functions to perform work, all mainstream browsing All devices support the onmousedown event.
onmousedown event syntax
onmousedown = "JavaScript function to be executed"
Onmousedown itself is a mouse event. Use the onmousedown event to monitor web page elements. When a user presses the mouse button on the element, onmousedown will immediately trigger a specific function to perform the work. It should be noted that the mouse button only needs to be clicked. The event will be triggered, and the function will be executed without releasing the button.
Onmousedown event example 1. Insert event in DIV area
Please click here to start the test with the mouse
</div>
onmousedown event example 2: insert event on button button
Post a Comment
0 Comments