topical media & game development

talk show tell print

professional-javascript-13-SystemDragAndDropExample3.htm / htm



  <html>
      <head>
          <title>System Drag And Drop Example</title>
          <script type="text/javascript">
              function handleDragDropEvent(oEvent) {
                  var oTextbox = document.getElementById("txt1");
                  oTextbox.value +=  oEvent.type + "\n";
              }                        
          </script>
      </head>
      <body>
          <p>Try dragging the text from the left textbox to the right one.</p>
          <p><input type="text" value="drag this text"
                    ondragstart="handleDragDropEvent(event)" ondrag="handleDragDropEvent(event)"
                    ondragend="handleDragDropEvent(event)" />
          <input type="text" ondragenter="handleDragDropEvent(event)" 
                 ondragover="handleDragDropEvent(event)" ondragleave="handleDragDropEvent(event)" 
                 ondrop="handleDragDropEvent(event)" /></p>
          <p><textarea rows="10" cols="25" readonly="readonly" id="txt1"></textarea></p>        
      </body>
  </html>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.