Skip to content
Discussion options

You must be logged in to vote

Just found the solution. Seems I can simply write the path into dataTransfer:

<div id="drag_source" draggable="true">Drag Me</div>
const dragSource = document.querySelector('#drag_source')

dragSource.addEventListener("dragstart", function (event) {
    event.dataTransfer.setData("text", 'D:\\Videos\\abc.mp4');
});

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@oopserian
Comment options

@lomirus
Comment options

@oopserian
Comment options

@creeper12356
Comment options

Answer selected by lomirus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants