Code
Execute
<!DOCTYPE html> <html> <head> <title>html tutorial - html5 - html code - html form - In 30Sec by Microsoft Award MVP - | wikitechy ondragover attribute</title> <style> .drag_div { width: 100px; height: 35px; padding: 10px; border: 1px solid #ff0000; } </style> </head> <body> <p>Drag the element:</p> <div class="drag_div" ondragover="dragOver(event)" > <p draggable="true" id="dragtarget">Drag me!</p> </div> <p id="drag"></p> <script> function dragOver(event) { document.getElementById("drag").innerHTML = "dragOver Triggered"; } </script> </body> </html>
Result