以下是从msdn拷贝的一段代码,好像有用 <BODY onload="divOwnCapture.setCapture()" onclick="divOwnCapture.releaseCapture();"> <DIV ID=divOwnCapture onmousemove="txtWriteLocation.value=event.clientX + event.clientY"; onlosecapture="alert(event.srcElement.id + ' lost mouse capture.')"> <P>Mouse capture has been set to this gray division (DIV) at load time using the setCapture method. The text area will track the mousemove event anywhere in the document.<BR><BR> <TEXTAREA ID=txtWriteLocation COLS=2></TEXTAREA> </DIV> <HR> <DIV ID=divNoCapture> <P>Click anywhere on the document to invoke the releaseCapture method, whereby the onlosecapture event will fire.</P> </DIV> </BODY>
<BODY onload="divOwnCapture.setCapture()"
onclick="divOwnCapture.releaseCapture();">
<DIV ID=divOwnCapture
onmousemove="txtWriteLocation.value=event.clientX
+ event.clientY";
onlosecapture="alert(event.srcElement.id
+ ' lost mouse capture.')">
<P>Mouse capture has been set to this gray division (DIV) at
load time using the setCapture method. The text area will track
the mousemove event anywhere in the document.<BR><BR>
<TEXTAREA ID=txtWriteLocation COLS=2></TEXTAREA>
</DIV>
<HR>
<DIV ID=divNoCapture>
<P>Click anywhere on the document to invoke the releaseCapture
method, whereby the onlosecapture event will fire.</P>
</DIV>
</BODY>