HTML draggable Attribute
Example
<p draggable="true">Drag me!</p>
<p draggable="false">No you can't drag me!</p>
Meaning
The draggable attribute is used to set whether or not an element is draggable.
Possible values
- A true, the element is draggable.
- A value of auto sets images and links with an href to be draggable and all other items to not be draggable.
- A false value turns off dragging.
Tip The draggable attributes requires JavaScript usage for real integration with elements.
Note: By default links and images are draggable.
Standard Syntax
<element draggable="true|false|auto">
Browser Support
Status
Applies to:
The draggable attribute can be used on the following element:
Element | Attribute |
---|---|
All HTML elements | draggable |
Attribute Values
Value | Description |
---|---|
auto | Specifies the uses of the default browser. |
false | Specifies the element is not draggable. |
true | Specifies the element is draggable. |