W3Schools.com

HTML5 draggable Attribute

HTML5 Global Attributes HTML5 Global Attributes

Example

A draggable paragraph:

<p draggable="true">This is a draggable paragraph.</p>

Try it yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The draggable attribute is currently supported in Firefox, Chrome, and Safari.


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 HTML5 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 in not draggable
auto Uses the default behavior of the browser


HTML5 Global Attributes HTML5 Global Attributes
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE