059-manual.html (1162B)
1 <!doctype html> 2 <title>drag & drop - dragging elements by text that extends out of them</title> 3 <style type="text/css"> 4 div { 5 height: 200px; 6 width: 200px; 7 background: blue; 8 white-space: nowrap; 9 } 10 </style> 11 <script type="text/javascript"> 12 window.onload = function () { 13 document.getElementsByTagName('div')[0].ondragstart = function (e) { 14 e.dataTransfer.effectAllowed = 'copy'; 15 e.dataTransfer.setData('text','dummy text'); 16 }; 17 }; 18 </script> 19 <div draggable="true"> Drag me</div> 20 <p>Drag the above text sideways. Pass if the drag placeholder shows that both the text and blue square are being dragged.</p>