when the mouse is released on the element code example
Example: javascript mouse up mouse down
<p id="myP" onmousedown="mouseDown()" onmouseup="mouseUp()">
<script>
function mouseDown() {
}
function mouseUp() {
}
</script>
<p id="myP" onmousedown="mouseDown()" onmouseup="mouseUp()">
<script>
function mouseDown() {
}
function mouseUp() {
}
</script>