Pixel Pete saysManual drag uses mousedown → mousemove → mouseup to reposition an element.
The classic drag: on mousedown record the offset and start listening for mousemove (on the document, so it works past the element's edge); update style.left/top as the pointer moves; on mouseup stop listening. The native HTML Drag-and-Drop API and Pointer Events now cover this, but the manual pattern still appears in custom controls.
Power-ups you unlock
mousedown → mousemove → mouseup sequence
Listen on document so dragging past edges works
Update style.left/top by the pointer delta
Pointer events / DnD API are modern alternatives
Quirks Mode attacks — common mistakes
Listening for mousemove on the element only
Forgetting to remove move/up listeners on drop
Using mouse-only code on touch devices
Boss battleMake a box draggable with the mousedown/move/up pattern.