CKTIS / HTML
HTML term or value: draggable
The `draggable` attribute controls whether an element can initiate native dragging, but it does not by itself implement data transfer or an accessible keyboard interaction.
Version: WHATWG HTML Living Standard; index snapshot date recorded separately
Syntax
<div draggable="true">…</div>draggable is an enumerated attribute with true and false tokens; a missing or invalid value produces the auto state. In that state, images and links with an address retain native draggable defaults, while an ordinary container is not draggable by default.
Use draggable="false" to explicitly disable native dragging for an image or link. For custom dragging, handle dragstart and put an appropriate type and payload in DataTransfer; the attribute does not define a drop target.
Drag and drop depends on a pointing device and is not a complete accessible interaction. Provide buttons or another keyboard operation for reordering and announce the result; dragging must not be the only way to complete a task.
The example compares an element with draggable="true" against an image without the attribute. The draggable property returns true for both: from the explicit token on the first element and from the image’s automatic default.
Examples
<!doctype html><meta charset="utf-8"><img id="auto" alt=""><div id="x" draggable="true">Drag</div><output id="result"></output><script>result.textContent=`explicit=${x.draggable}; imageDefault=${auto.draggable}; raw=${x.getAttribute("draggable")}`;</script>Result
explicit=true; imageDefault=true; raw=true
The executed example verifies the distinction between an ordinary element’s explicit token and an image’s native default.