Which attribute enables dragging on an element in HTML5?

Learn web design with our comprehensive test guide. Improve your skills with flashcards and multiple choice questions. Each question includes hints and explanations. Get ready to ace your exam!

Multiple Choice

Which attribute enables dragging on an element in HTML5?

Explanation:
Dragging is controlled by a boolean attribute on the element. When the draggable attribute is present, the element becomes draggable in HTML5’s drag-and-drop system. The actual value you assign doesn’t matter—the attribute’s presence is what enables dragging. So you’d add draggable to enable it (you can write just draggable or draggable="true"). If you want to disable dragging, you remove the attribute. The dragstart option listed is an event that fires when dragging begins, not a way to enable dragging.

Dragging is controlled by a boolean attribute on the element. When the draggable attribute is present, the element becomes draggable in HTML5’s drag-and-drop system. The actual value you assign doesn’t matter—the attribute’s presence is what enables dragging. So you’d add draggable to enable it (you can write just draggable or draggable="true"). If you want to disable dragging, you remove the attribute. The dragstart option listed is an event that fires when dragging begins, not a way to enable dragging.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy