HTML draggable attribute

Time:2022-5-5

draggable

This attribute specifies whether the element can be dragged. By default, links and avatars can be dragged

event

Dragged element

  1. ondragstartInstant trigger of dragging
  2. ondragContinuous triggering during dragging
  3. ondragendDrag end trigger

Target element

  1. ondragenterTrigger for entering the target element (mouse cursor entry)
  2. ondragoverEntering and leaving the target element is triggered continuously
  3. ondragleaveTriggered when leaving the target element
  4. ondropRelease the mouse trigger on the target element

matters needing attention

  1. By default, one element cannot be dragged onto another,ondropThe event cannot be triggered and needs to be triggered inondragoverBlock default events in