I have this code that makes a drag & drop that I pulled from the Javascript page, it works fine. I just have a problem, I need the ID of the div where it fell.
I did this but it does not work, I get undefinied the grid ID.
function dragstart_handler(ev) {
ev.dataTransfer.setData("text/plain", ev.target.id);
}
function dragover_handler(ev) {
ev.preventDefault();
}
function drop_handler(ev) {
ev.preventDefault();
var data = ev.dataTransfer.getData("text");
var idModulo = data;
var idGrid = $(data).closest('div').attr('id');
alert('El módulo es: '+idModulo+' y el grid es: '+idGrid);
}