<p onmouseup="mouseUp()"> - Javascript DOM Event

Javascript examples for DOM Event:onmouseup

Description

The onmouseup event occurs when a user releases a mouse button over an element.

Summary

Bubbles Yes
Cancelable Yes
Supported HTML tags: All HTML elements, EXCEPT: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title>

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p id="demo" onmousedown="mouseDown()" onmouseup="mouseUp()">Click me.</p>

<script>
function mouseDown() {/*w w w .j  a v  a 2  s  .c om*/
    document.getElementById("demo").innerHTML = "mouse button is down";
}

function mouseUp() {
    document.getElementById("demo").innerHTML = "mouse button released";
}
</script>

</body>
</html>

Related Tutorials