002.xhtml (661B)
1 <?xml version="1.0" encoding="utf-8"?> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>Dropzone attribute: move</title> 5 <style type="text/css"> 6 div 7 {background-color:navy; 8 width:40px; 9 height:40px; 10 padding:40px; 11 color:white;} 12 </style> 13 </head> 14 <body onload="document.querySelector('input').select()"> 15 <p><input value="Drag me"/></p> 16 <div dropzone="move string:text/plain" ondrop="document.querySelector('div').appendChild(document.createTextNode((event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'))"/> 17 <p>You should be able to drag selection to navy box below. You should see word PASS once you drop it.</p> 18 </body> 19 </html>