Can you please tell me how you can change the cursor when the element is being dragged and be over the element where the dragged element can be placed?
On mac os, this cursor is named copy.
function allowDrop(ev) {
ev.preventDefault();
}
function drag(ev) {
ev.dataTransfer.setData("text", ev.target.id);
}
function drop(ev) {
ev.preventDefault();
var data = ev.dataTransfer.getData("text");
var elem = document.getElementById(data);
ev.target.appendChild(elem);
}
.drop {
width: 100px;
height: 100px;
background: blue;
}
.drag {
width: 50px;
height: 50px;
background: red;
cursor: move!important;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="drop" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
<div id="drag_elem" class="drag" draggable="true" ondragstart="drag(event);"></div>