Horje
HTML draggable Attribute

Definition and Usage

The draggable attribute specifies whether an element is draggable or not.

Tip: Links and images are draggable by default.

Tip: The draggable attribute is often used in drag and drop operations. Read our HTML Drag and Drop tutorial to learn more.


Browser Support

The numbers in the table specify the first browser version that fully supports the attribute.

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 default behavior of the browser

How to add A draggable paragraph

This is a draggable paragraph. Drag this element into the rectangle.
index.html
Example: HTML
 <p draggable="true">This is a draggable paragraph.</p> 

Output should be:

How to add A draggable paragraph

How to add A draggable paragraph with true element

This is a draggable paragraph. Drag this element into the rectangle.
index.html
Example: HTML
 <p draggable="true">This is a draggable paragraph.</p> 

Output should be:

How to add A draggable paragraph with true element

How to add A draggable paragraph with false element

false - Specifies that the element is not draggable
index.html
Example: HTML
 <p draggable="false">This is a draggable paragraph.</p> 

Output should be:

How to add A draggable paragraph with false element

How to add A draggable paragraph with auto element

auto - Uses the default behavior of the browser.
index.html
Example: HTML
 <p draggable="auto">This is a draggable paragraph.</p> 

Output should be:

How to add A draggable paragraph with auto element




html draggable attribute

Related Articles
HTML accesskey Attribute HTML Global Attributes
HTML class Attribute HTML Global Attributes
HTML contenteditable Attribute HTML Global Attributes
HTML data-* Attributes HTML Global Attributes
HTML dir Attribute HTML Global Attributes
HTML draggable Attribute HTML Global Attributes
HTML enterkeyhint Attribute HTML Global Attributes
HTML hidden Attribute HTML Global Attributes
HTML id Attribute HTML Global Attributes
HTML inert Attribute HTML Global Attributes
HTML inputmode Attribute HTML Global Attributes
HTML lang Attribute HTML Global Attributes
HTML popover Attribute HTML Global Attributes
HTML spellcheck Attribute HTML Global Attributes
HTML style Attribute HTML Global Attributes
HTML tabindex Attribute HTML Global Attributes
HTML title Attribute HTML Global Attributes
HTML translate Attribute HTML Global Attributes
HTML Global Attributes HTML Global Attributes

Single Articles
How to add A draggable paragraphHTML Global Attributes
How to add A draggable paragraph with true elementHTML Global Attributes
How to add A draggable paragraph with false elementHTML Global Attributes
How to add A draggable paragraph with auto elementHTML Global Attributes

Type:
Develop
Category:
Web Tutorial
Sub Category:
HTML Global Attributes
Uploaded by:
Admin


Reffered: https://www.w3schools.com/tags/att_global_draggable.asp