onmouseup event



 The onmouseup event is used to determine whether a netizen has the effect of "releasing the mouse button". When a netizen’s mouse button is originally pressed on a webpage element with an onmouseup event, once it is released, it will be monitored by the onmouseup event (or Detect), you can trigger a specific JavaScript function to do a specific job. Like most JavaScript events , this event is simply used to monitor the behavior of netizens. All mainstream browsers support the onmouseup event function.


Basic syntax of onmouseup

onmouseup = "javascript function to be triggered"


The "javascript function to be triggered" in the basic syntax is a necessary item, otherwise onmouseup will be meaningless.

onmouseup example
<div onmouseup="alert('Your mouse is released!');">
Please press the mouse in this test area and then release the button
</div>
Example output
Please click the mouse on this test area and then release the button
In this example, a test area is created through the DIV block. The onmouseup event monitoring syntax is inserted in the block. So when we press the mouse on the test area and release the mouse button, JavaScript will be triggered immediately The alert function pops up a dialog window. Of course, we can also replace alert with other functions.

Post a Comment

0 Comments