There is no object inside event called transfer. One thing you can do is try event.setData(), but I don't think that's what you want either, because the dragstart and drop events are two different event objects.

You can instead have a separate local variable to use. E.g.

var draggedType = null;'img').on('dragstart', function() { 
    var draggedType ='type');
    console.log("Drag starts with "+ draggedType);
});'.drop').on('drop', function() {
    console.log("Drag ends with "+ draggedType);
    // do something with draggedType here

    draggedType = null; // reset draggedType to null when done, just in case

Related Query