What are drag-and-drop applications?
Drag-and-drop applications are graphical user interfaces that support pointing-device gestures, where the user selects a virtual object by “grabbing” it and dragging it onto another virtual object. In general, these are virtual objects whose purpose depends entirely on what you’re building them for.
How to perform drag and drop
The basic sequence is: move the pointer to the object; press and hold the button on the mouse or other pointing device to “grab” the object; drag the object to the desired location by moving the pointer there; then drop the object by releasing the button.
Dragging requires more physical effort than simply moving a pointing device without holding a button down, which is why a user can’t move as quickly or precisely while dragging. For a better sense of the physical effort involved, it’s worth reading up on Fitts’s Law.
Drag and drop in HTML5
HTML5 supports several kinds of drag-and-drop behaviour, including dragging and dropping text and HTML code, dragging and dropping HTML elements, and dragging and dropping files. When an HTML element is dragged to a new position, its ID is sent to the destination parent element โ effectively sending text, which is why it’s considered the first of these groups. Which type you use depends on what action you actually need.
Drag and drop on touch screens
Touch screens support drag-and-drop gestures too, just without a pointer โ most people would call it a long-press drag and drop instead.
Whatever you call it, drag and drop is a genuinely useful shorthand for opening, moving, and copying files and objects, across a lot of different contexts.