Ziehbares HTML - Attribut
Beispiel
Ein ziehbarer Absatz:
<p draggable="true">This is a draggable paragraph.</p>
Definition und Verwendung
Das draggable
Attribut gibt an, ob ein Element ziehbar ist oder nicht.
Tipp: Links und Bilder sind standardmäßig ziehbar.
Tipp: Das draggable
Attribut wird häufig bei Drag-and-Drop-Operationen verwendet. Lesen Sie unser HTML-Drag-and-Drop-Tutorial , um mehr zu erfahren.
Browser-Unterstützung
Die Zahlen in der Tabelle geben die erste Browserversion an, die das Attribut vollständig unterstützt.
Attribute | |||||
---|---|---|---|---|---|
draggable | 4.0 | 9.0 | 3.5 | 6.0 | 12.0 |
Syntax
<element draggable="true|false|auto">
Attributwerte
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 |
Verwandte Seiten
HTML-Tutorial: HTML-Attribute
HTML-Tutorial: HTML5-Drag-and-Drop
JavaScript-Referenz: Das ondrag-Ereignis