143.xhtml (827B)
1 <?xml version="1.0" encoding="utf-8"?> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>Large text selection drag and drop</title> 5 <style type="text/css"> 6 textarea 7 {width:300px; 8 height:100px; 9 margin-top:20px; 10 padding:10px;} 11 </style> 12 <script type="application/ecmascript"> 13 function start(event) 14 {var p = document.querySelector('p:last-child'), s = p.firstChild.nodeValue; 15 for(var i = 0; i != 12; i++) 16 {s = s + ' ' + s;} 17 p.firstChild.nodeValue = 'Start of selection. ' + s + ' End of selection'; 18 window.getSelection().selectAllChildren(p);} 19 </script> 20 </head> 21 <body onload="start()"> 22 <p>Try to drag selection below to the textarea. Copy of selection should end up in the textarea once you drop it there.</p> 23 <p><textarea placeholder="Drop selection here"/></p> 24 <p>Large selection.</p> 25 </body> 26 </html>