Våra volontärer har inte översatt denna artikel till Svenska ännu. Gå med oss och hjälpa till att få jobbet gjort!
Du kan också läsa artikeln på English (US).

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.


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 compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
draggableChrome Full support YesEdge Full support YesFirefox Full support 2IE Full support YesOpera Full support 12Safari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?


Full support  
Full support
Compatibility unknown  
Compatibility unknown

See also

Dokumenttaggar och bidragare

Senast uppdaterad av: Tigt,