HTML event attribute onmouseup








The onmouseup attribute event is triggered when a mouse button is released.

What's new in HTML5

None.

Syntax

<element onmouseup="script or Javascript function name">

Supported Tags

All HTML elements, EXCEPT:

<base>, 
<bdo>, 
<br>, 
<head>, 
<html>, 
<iframe>, 
<meta>, 
<param>, 
<script>, 
<style>, 
<title>




Browser compatibility

onmouseup Yes Yes Yes Yes Yes

Example

<!DOCTYPE html>
<html>
<body>
<!--from w w  w.  j  a  v  a2s.  co m-->
<p id="p1" onmouseover="onmouseOver()" onmouseup="mouseUp()">
Click the text! 
</p>

<script>
function onmouseOver() {
    console.log("onmouseOver");
}

function mouseUp() {
    console.log("up");
}
</script>

</body>
</html>

Click to view the demo