The mouseup event fires when the mouse button is released while it is over the target object.
Scripting mouseup events through Javascript and the DOM:
Javascript CODE EXAMPLE
<script type="text/javascript">
function addEventsToHTML(){
var div1 = document.getElementById('div1');
div1.onmouseup = doStuff;
function doStuff(){
this.style.width = "200px";
}
}
window.onload = addEventsToHTML;
</script>
<div id="div1" style="background:#FCE;">Div content</div>
Establishing mouseup events direct on the html elements:
Javascript CODE EXAMPLE
<script type="text/javascript">
function doStuff(target){
target.style.width = "200px";
}
</script>
<div onmouseup="doStuff(this);" style="background:#FCE;">Div content</div>