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