HTML draggable Attribute

HTML 全局属性HTML Global Attributes

Examples

A draggable paragraph:

<p draggable="true">This is a movable paragraph. Drag the paragraph into the rectangle above.</p>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Internet Explorer 9+, Firefox, Opera, Chrome, and Safari support the draggable attribute.

Note:Internet Explorer 8 and earlier IE versions do not support the draggable attribute.


Definition and Usage

The draggable attribute specifies whether an element is draggable.

Tip:Links and images are draggable by default.

Tip:The draggable attribute is often used in drag and drop operations. Read ourHTML5 Drag and Drop Tutorial, to learn more.


Differences Between HTML 4.01 and HTML5

The draggable attribute is new in HTML5.


Syntax

<element draggable="true|false|auto">

Attribute Values

Value Description
true Specifies that the element is draggable.
false Specifies that the element is not draggable.
auto Uses the browser's default behavior.


HTML 全局属性HTML Global Attributes Other Extensions