Sometimes, we want to disable drag and drop on HTML elements.
In this article, we’ll look at how to disable drag and drop on HTML elements.
How to disable drag and drop on HTML elements?
To disable drag and drop on HTML elements, we set the draggable
attribute to false
.
For instance, we write
<div draggable="false"></div>
to set the draggable
attribute to false
so that the div can’t be dragged.
Conclusion
To disable drag and drop on HTML elements, we set the draggable
attribute to false
.