Horje
What is 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
What is HTML accesskey Attribute HTML Global Attributes
What is HTML class Attribute HTML Global Attributes
What is HTML contenteditable Attribute HTML Global Attributes
What is HTML data-* Attributes HTML Global Attributes
What is HTML dir Attribute HTML Global Attributes
What is HTML draggable Attribute HTML Global Attributes
What is HTML enterkeyhint Attribute HTML Global Attributes
What is HTML hidden Attribute HTML Global Attributes
What is HTML id Attribute HTML Global Attributes
What is HTML inert Attribute HTML Global Attributes
What is HTML inputmode Attribute HTML Global Attributes
What is HTML lang Attribute HTML Global Attributes
What is HTML popover Attribute HTML Global Attributes
What is HTML spellcheck Attribute HTML Global Attributes
What is HTML style Attribute HTML Global Attributes
What is HTML tabindex Attribute HTML Global Attributes
What is HTML title Attribute HTML Global Attributes
What is HTML translate Attribute HTML Global Attributes
What are the 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

Read Full:
HTML Global Attributes
Type:
Develop
Category:
Web Tutorial
Sub Category:
HTML Global Attributes
Uploaded by:
Admin
Views:
24


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