The draggable global attribute is an enumerated attribute that indicates whether the element can be dragged, using the HTML Drag and Drop API. It can have the following values:
true
, which indicates the element may be draggedfalse
, which indicates the element may not be dragged.If this attribute is not set, its default value is auto
, meaning the behavior should be the one defined by default by the browser.
This attribute is an enumerated one and not a Boolean one. This means that the explicit usage of one of the values true
or false
is mandatory and that a shorthand like <label draggable>Example Label</label>
is not allowed. The correct usage is <label draggable="true">Example Label</label>
.
By default, only text selections, images, and links can be dragged. For all other elements, the event ondragstart
must be set for the drag and drop mechanism to work, as shown in this comprehensive example.
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 |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | Yes | Yes | 2 | Yes | 12 | Yes |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | Yes | Yes | Yes | 4 | Yes | Yes | ? |
© 2005–2018 Mozilla Developer Network 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