HTML Intro

HTML Intro Quiz

HTML Intro Exercise

HTML Basics

HTML Basic Quiz

HTML Basic Exercise

HTML Advance

HTML Advance Quiz

HTML Advance Exercise

HTML Tags List

HTML Global Attributes

HTML Attributes


HTML ondragleave Attribute

HTML ondragleave Attribute



The ondragleave attribute fires when a draggable element or text selection leaves a valid drop target. Links are draggable by default similar to images. We can apply this attribute/event on all HTML elements.


Event Attributes in drag and drop are:-


  • Events fired on the draggable target.
  1. ondragstart event fired when the user starts to drag an element.
  2. ondrag event fired when an element is being dragged.
  3. ondragend event fired when the user has finished dragging the element.
  • Events fired on the drop target.
  1. ondragenter event fired when the dragged element enters the drop target.
  2. ondragover event fired when the dragged element is over the drop target.
  3. ondragleave event fired when the dragged element leaves the drop target.
  4. ondrop event fired when the dragged element is dropped on the drop target.


Used With:-


Elements Event
All elements in HTML ondragleave




Its syntax is:- < element ondragleave="your_script" >

Code Explanation

All Tutorials related to HTML Attributes

All Sections related to HTML