Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<title>drag &amp; drop - pressing tab while dragging</title>
body > div {
height: 200px;
width: 200px;
background-color: orange;
body {
height: 5000px;
p {
margin-top: 1000px;
window.onload = function() {
document.getElementsByTagName('div')[0].ondragstart = function(e) {
e.dataTransfer.effectAllowed = 'copy';
e.dataTransfer.setData('text', 'dummy text');
<noscript>Enable JavaScript and reload</noscript>
<p>Drag the orange square. While still dragging, press the Tab key on your keyboard. Fail if the page scrolls.</p>
<div draggable="true"></div>