I’m dragging and dropping a DIV from a parent window onto a nested iframe but I can’t get any info on the dragged DIV. In the source of the iframe I have this
window.addEventListener('load', e => {
let frm = document.body;
frm.addEventListener("drop", droppedOn);
});
function droppedOn(ev) {
ev.preventDefault();
console.log(ev)
...
If I drag and drop a file from my desktop onto the iframe then there is data in dataTransfer which identifies the dropped file.
When I drag a DIV from the parent onto the iframe, dataTransfer is empty (which I guess is expected) but ev’s srcElement, target, and toElement all reference a DIV that is used as a background in the iframe source, frmElement is null, and relatedTarget is null.
How can I get a reference to the DIV that was dragged from the parent window?