W3cubDocs

/HTML

draggable (attribute)

The draggable global attribute is an enumerated attribute that indicates whether the element can be dragged, either with native browser behavior or the HTML Drag and Drop API.

draggable can have the following values:

  • true: the element can be dragged.
  • false: the element cannot be dragged.

This attribute is enumerated and not Boolean. A value of true or false is mandatory, and shorthand like <img draggable> is forbidden. The correct usage is <img draggable="false">.

If this attribute is not set, its default value is auto, which means drag behavior is the default browser behavior: only text selections, images, and links can be dragged. For other elements, the event ondragstart must be set for drag and drop to work, as shown in this comprehensive example.

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'draggable' in that specification.
Living Standard No change from latest snapshot, HTML 5.1
HTML 5.2
The definition of 'draggable' in that specification.
Recommendation No change
HTML 5.1
The definition of 'draggable' in that specification.
Recommendation Snapshot of HTML Living Standard, initial definition

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
draggable Yes 12 2 Yes 12 Yes
Mobile
Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
draggable Yes Yes 4 Yes Yes Yes

See also

© 2005–2020 Mozilla and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable