View video tutorial

HTML ondragenter Attribute

HTML

The HTML ondragenter attribute is an event handler that triggers a script to execute when a draggable element or text selection enters a valid drop target.

Definition and Usage


➔ This signals that a draggable item has crossed the boundary of a potential drop target.

➔ Typically used to provide visual feedback to the user, indicating that the target location is valid for dropping.

➔ Drag-and-drop works with events such as ondragstart, ondrag, ondragenter, ondragleave, ondragover, ondrop, and ondragend, to manage the drag-and-drop process.

  • ondragstart
  • ondrag
  • ondragenter
  • ondragleave
  • ondragover
  • ondrop
  • ondragend

Applies to

This attribute can be used on the following element.

Attribute Element
ondragenter All visible elements