JavaScript Tutorial/Drag Drop/ondrop

Материал из Web эксперт
Перейти к: навигация, поиск

ondrop event handler (IE)

<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>drag this text</p>
        <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>