DHTML Methods
Removes mouse capture from the object in the current document.
object.releaseCapture ( )
No return value.
For releaseCapture to have an effect, mouse capture must have been set through the setCapture method.
The releaseCapture method can be invoked off the document object. Doing so makes it unnecessary to determine which element has capture in order to programmatically release it. Other actions also release document capture, such as, displaying a modal dialog and switching focus to another application or browser window.
The example illustrates how to invoke the releaseCapture method on the document object.
Sample Code
<body onload="theDiv.setCapture ( )"
onclick="document.releaseCapture ( )">
<div align="center">
X <input id="txtX" size=4> Y <input id="txtY" size=4>
<div id="theDiv"
onmousemove="txtX.value=event.clientX;
txtY.value=event.clientY";
onlosecapture="alert (
'Mouse capture for the BODY is over.' )">
<p>Mouse capture has been set to this division
. . . </p>
<input size=25 value="Move mouse over this object.">
<input type=button value="Click Anywhere to End
Mouse Capture">
</div>
Show me
onlosecapture, setCapture