summaryrefslogtreecommitdiff
path: root/devdocs/html/global_attributes%2Fdraggable.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/html/global_attributes%2Fdraggable.html')
-rw-r--r--devdocs/html/global_attributes%2Fdraggable.html57
1 files changed, 57 insertions, 0 deletions
diff --git a/devdocs/html/global_attributes%2Fdraggable.html b/devdocs/html/global_attributes%2Fdraggable.html
new file mode 100644
index 00000000..cd4f8b99
--- /dev/null
+++ b/devdocs/html/global_attributes%2Fdraggable.html
@@ -0,0 +1,57 @@
+<header><h1>draggable</h1></header><div class="section-content">
+<p>The <code>draggable</code> <a href="../global_attributes">global attribute</a> is an <a href="https://developer.mozilla.org/en-US/docs/Glossary/Enumerated">enumerated</a> attribute that indicates whether the element can be dragged, either with native browser behavior or the <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API">HTML Drag and Drop API</a>.</p> <p> The <code>draggable</code> attribute may be applied to elements that strictly fall under the <a href="https://developer.mozilla.org/en-US/docs/Glossary/Namespace">HTML namespace</a>, which means that it cannot be applied to <a href="https://developer.mozilla.org/en-US/docs/Web/SVG">SVGs</a>. For more information about what namespace declarations look like, and what they do, see <a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Namespaces_Crash_Course">Namespace crash course</a>. </p> <p><code>draggable</code> can have the following values:</p> <ul> <li>
+<code>true</code>: the element can be dragged.</li> <li>
+<code>false</code>: the element cannot be dragged.</li> </ul> <div class="notecard warning" id="sect1"> <p><strong>Warning:</strong> This attribute is <em><a href="https://developer.mozilla.org/en-US/docs/Glossary/Enumerated">enumerated</a></em> and not <em>Boolean</em>. A value of <code>true</code> or <code>false</code> is mandatory, and shorthand like <code>&lt;img draggable&gt;</code> is forbidden. The correct usage is <code>&lt;img draggable="false"&gt;</code>.</p> </div> <p>If this attribute is not set, its default value is <code>auto</code>, which means drag behavior is the default browser behavior: only text selections, images, and links can be dragged. For other elements, the event <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dragstart_event"><code>ondragstart</code></a> must be set for drag and drop to work, as shown in this <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Drag_operations">comprehensive example</a>.</p>
+</div>
+<h2 id="specifications">Specifications</h2>
+<div class="_table"><table class="standard-table">
+<thead><tr><th scope="col">Specification</th></tr></thead>
+<tbody><tr><td><a href="https://html.spec.whatwg.org/multipage/dnd.html#the-draggable-attribute">HTML Standard <br><small># the-draggable-attribute</small></a></td></tr></tbody>
+</table></div>
+<h2 id="browser_compatibility">Browser compatibility</h2>
+<div class="_table"><table>
+<thead>
+<tr id="bct-browser-type">
+<th></th>
+<th colspan="6">Desktop</th>
+<th colspan="6">Mobile</th>
+</tr>
+<tr id="bct-browsers">
+<th></th>
+<th>Chrome</th>
+<th>Edge</th>
+<th>Firefox</th>
+<th>Internet Explorer</th>
+<th>Opera</th>
+<th>Safari</th>
+<th>WebView Android</th>
+<th>Chrome Android</th>
+<th>Firefox for Android</th>
+<th>Opera Android</th>
+<th>Safari on IOS</th>
+<th>Samsung Internet</th>
+</tr>
+</thead>
+<tbody><tr>
+<th><code>draggable</code></th>
+<td class="bc-supports-yes">4</td>
+<td class="bc-supports-yes">12</td>
+<td class="bc-supports-yes">2</td>
+<td class="bc-supports-yes">Yes</td>
+<td class="bc-supports-yes">12</td>
+<td class="bc-supports-yes">5</td>
+<td class="bc-supports-yes">4.4</td>
+<td class="bc-supports-yes">18</td>
+<td class="bc-supports-yes">4</td>
+<td class="bc-supports-yes">14</td>
+<td class="bc-supports-yes">4.2</td>
+<td class="bc-supports-yes">1.0</td>
+</tr></tbody>
+</table></div>
+<h2 id="see_also">See also</h2>
+<div class="section-content"><ul> <li>All <a href="../global_attributes">global attributes</a>.</li> </ul></div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; 2005&ndash;2023 MDN contributors.<br>Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.<br>
+ <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable" class="_attribution-link">https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable</a>
+ </p>
+</div>