Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<title>drag &amp; drop - cursors after dragging outside window</title>
body > div {
height: 100px;
width: 100px;
display: inline-block;
background: orange;
body > div + div {
background: blue;
color: black;
<script type="text/javascript">
window.onload = function() {
var orange = document.getElementsByTagName('div')[0];
orange.ondragstart = function(e) {
e.dataTransfer.effectAllowed = 'all';
e.dataTransfer.setData('Text', 'dummy text');
var copydiv = document.getElementsByTagName('div')[1];
copydiv.ondragenter = copydiv.ondragover = function(e) {
e.dataTransfer.dropEffect = 'copy';
var movediv = document.getElementsByTagName('div')[2];
movediv.ondragenter = movediv.ondragover = function(e) {
e.dataTransfer.dropEffect = 'move';
var linkdiv = document.getElementsByTagName('div')[3];
linkdiv.ondragenter = linkdiv.ondragover = function(e) {
e.dataTransfer.dropEffect = 'link';
var nodrop = document.getElementsByTagName('div')[4];
nodrop.ondragenter = nodrop.ondragover = function(e) {
e.dataTransfer.dropEffect = 'none';
<div draggable='true'>&nbsp;</div>
<p>Use your mouse to drag the orange box out of the browser window (not over the system taskbar), then back into the browser window, and over each of the blue squares in turn.
While dragging over the squares, the mouse cursor should be the one given by the text in the relevant square.</p>
<p>This test only applies to platforms with a mouse cursor that can change to indicate drop status.</p>
<noscript><p>Enable JavaScript and reload</p></noscript>