To capture the mouse at any time is not good behavior, I think why setCapture not provided.
However, in order to capture a mouse for drag and drop, you just need to handle the mouse events (mouse {up, down, move}) of the document object, which can be triggered by drag and drop even outside the client area.
<html> <head> <title>Capture test</title> </head> <body> <script type="text/javascript"> document.onmousedown = function () { state.innerHTML = "Dragging started"; }; document.onmousemove = function (e) { coord.innerHTML = e.clientX + ',' + e.clientY; } document.onmouseup = function (e) { state.innerHTML = "Dragging stopped"; } </script> <p id="state">.</p> <p id="coord">.</p> </body> </html>
Rnmss source share