006.xhtml (811B)
1 <?xml version="1.0" encoding="utf-8"?> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>Removing a element during drag and drop of link</title> 5 <style type="text/css"> 6 div 7 {min-height:100px; 8 width:100px; 9 padding:20px; 10 color:white; 11 background-color:navy;} 12 </style> 13 </head> 14 <body> 15 <p><a href="data:text/plain,1" ondragstart="event.dataTransfer.effectAllowed = 'copy';document.querySelector('p').removeChild(document.querySelector('a'))">Drag me</a></p> 16 <p>Drag link above to the navy box below and drop it. You should see word PASS once you drop it in the box.</p> 17 <div ondragover="return false" ondrop="document.querySelector('div').appendChild(document.createTextNode((event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,1')?'PASS':'FAIL'))"/> 18 </body> 19 </html>