'dataTransfer' Example : dataTransfer : Javascript Objects JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Javascript Objects » dataTransfer »

 

'dataTransfer' Example



    
<html>
<head>
<script language="JavaScript">
function transferDrop() {
    window.event.srcElement.innerText = window.event.dataTransfer.getData("text");
    window.event.returnValue = false

function transferDrag() { 
    window.event.dataTransfer.dropEffect = 'move'; 
    window.event.returnValue = false

</script>
</head>
<body>
<p id="mySource" 
   ondragstart="window.event.dataTransfer.effectAllowed = 'move';">
   Highlight text in this paragraph and drag it to the text area below
</p>
<textarea id="myTarget" 
          ondrop="transferDrop();" 
          ondragover="window.event.returnValue = false;" 
          ondragenter="transferDrag();">
</textarea>
</body>
</html>

    
      
      



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Javascript Objects
» dataTransfer