HTML ondragleave Event Attribute
HTML ondragleave Event Attribute
The ondragleave
event attribute triggers when a draggable element leaves a valid drop target.
Example
HTML Online Editor
<!DOCTYPE html>
<html>
<head>
<style>
#myIDdiv {
margin-top: 150px;
width: 150px;
text-align: center;
border: 1px solid #8c8c8c;
}
</style>
</head>
<body>
<p id="point"></p>
<div id="myIDdiv" ondragleave="myFunction(event)">
<p draggable="true">Drag me out</p>
</div>
<script>
function myFunction(e){
document.getElementById("point").innerHTML = "Drag Leaved";
}
</script>
</body>
</html>
Attribute Value
Value | Explanation |
---|---|
script | Script runs when a draggable element leaves a valid drop target. |
Reminder
Hi Developers, we almost covered 99.5% of HTML Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in HTML.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.