Web/HTML/Global attributes/draggable

From Get docs


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 StandardThe definition of 'draggable' in that specification. Living Standard No change from latest snapshot, HTML 5.1
HTML 5.2The definition of 'draggable' in that specification. Recommendation No change
HTML 5.1The definition of 'draggable' in that specification. Recommendation Snapshot of HTML Living Standard, initial definition

Browser compatibility

Update compatibility data on GitHub

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

Full support Yes

Edge

Full support 12

Firefox

Full support 2

IE

Full support Yes

Opera

Full support 12

Safari

Full support Yes

WebView Android

Full support Yes

Chrome Android

Full support Yes

Firefox Android

Full support 4

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support Yes

Legend

Full support  
Full support


See also