Disable Drag and Drop on HTML elements?

This works. Try it.

<BODY ondragstart="return false;" ondrop="return false;">

You can disable dragging simply by using draggable="false" attribute.

https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable http://www.w3schools.com/tags/att_global_draggable.asp


Try preventing default on mousedown event:

<div onmousedown="event.preventDefault ? event.preventDefault() : event.returnValue = false">asd</div>

or

<div onmousedown="return false">asd</div>

Tags:

Javascript

Css