Code
Execute
<!DOCTYPE html> <html> <head> <title>Wikitechy ondragleave 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" ondragleave="dragLeave(event)" > <p draggable="true" id="dragtarget">Drag me! </p> </div> <p id="drag"> </p> <script> function dragLeave(event) { document.getElementById("drag").innerHTML = "dragLeave Triggered"; } </script> </body> </html>
Result