---
title: "Discussion on \"How to Implement Drag and Drop in Vanilla JS\" | Hashnode"
description: "Discussion on \"How to Implement Drag and Drop in Vanilla JS\". You don't need to download a special package to create drag and drop functionality. Learn how to do it yourself in vanilla JavaScript!"
url: "https://hashnode.com/posts/how-to-implement-drag-and-drop-in-vanilla-js/61284dea22e1ba252a88048a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to Implement Drag and Drop in Vanilla JS](https://veewren.hashnode.dev/how-to-implement-drag-and-drop-in-vanilla-js?utm_source=hashnode&utm_medium=feed)

You don't need to download a special package to create drag and drop functionality. Learn how to do it yourself in vanilla JavaScript!

Aug 27, 2021 · 5 min read · veewren.hashnode.dev  
Updated Sep 15, 2021  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#html5](https://hashnode.com/tag/html5)

## Written by

[Veronica Stork](https://hashnode.com/@veewren)

@veewren · New York

  
[View profile](https://hashnode.com/@veewren)

Technical writer and software dev

I am a software dev with experience in (mostly) React/ES6 with a Node backend. Right now, I'm working as a tech writer for Sitecore.

## Responses 5

Markdown supported · ⌘↵ to post

[MD SAMIR](https://hashnode.com/@ryuzaki979)

[Sep 3, 2021](https://hashnode.com/posts/how-to-implement-drag-and-drop-in-vanilla-js/61284dea22e1ba252a88048a/comment/6131a15377de087890b8ed8d)

Is there any article related to how to save to localStorage after sorting?

[Veronica Stork](https://hashnode.com/@veewren)

[Sep 3, 2021](https://hashnode.com/posts/how-to-implement-drag-and-drop-in-vanilla-js/61284dea22e1ba252a88048a/comment/6131a15377de087890b8ed8d#reply-61323d375b12102f2987c872)

[MD SAMIR](https://hashnode.com/@ryuzaki979)\- I would love to write one! Just so I’m sure what you’re asking: you mean how to store the to do tasks in local storage?

[MD SAMIR](https://hashnode.com/@ryuzaki979)

[Sep 3, 2021](https://hashnode.com/posts/how-to-implement-drag-and-drop-in-vanilla-js/61284dea22e1ba252a88048a/comment/6131a15377de087890b8ed8d#reply-6132674a36015b2f4e1288c2)

[Veronica Stork](https://hashnode.com/@veewren) Yes something like that. How to store the position order of items and use it when reloading

[Vikram Hegde](https://hashnode.com/@VikramCodes)

[Aug 31, 2021](https://hashnode.com/posts/how-to-implement-drag-and-drop-in-vanilla-js/61284dea22e1ba252a88048a/comment/612e31551dd572151d81d37f)

Wow! Had no idea it would be this easy. Thanks !!

[Gaston Morales](https://hashnode.com/@gmorales254)

[Aug 28, 2021](https://hashnode.com/posts/how-to-implement-drag-and-drop-in-vanilla-js/61284dea22e1ba252a88048a/comment/612a1bc82858872661b993da)

Hey! Good article.

[Luciano Mammino](https://hashnode.com/@loige)

[Aug 28, 2021](https://hashnode.com/posts/how-to-implement-drag-and-drop-in-vanilla-js/61284dea22e1ba252a88048a/comment/612a19b9fd0bf8636d76b8aa)

Such a great tutorial! We should all do more vanilla JavaScript these days :)

Thanks [Veronica Stork](https://hashnode.com/@veewren)

[Veronica Stork](https://hashnode.com/@veewren)

[Aug 30, 2021](https://hashnode.com/posts/how-to-implement-drag-and-drop-in-vanilla-js/61284dea22e1ba252a88048a/comment/612a19b9fd0bf8636d76b8aa#reply-612c3c002858872661b9c5b7)

I agree. I've been using React for a while now, but I thought it would be good to go back to the basics and use vanilla JS!

[Vijay Thirugnanam](https://hashnode.com/@vijayst)

[Aug 27, 2021](https://hashnode.com/posts/how-to-implement-drag-and-drop-in-vanilla-js/61284dea22e1ba252a88048a/comment/61287cd522e1ba252a880977)

What a nice article. I will bookmark this article and try to do it step by step.

[Veronica Stork](https://hashnode.com/@veewren)

[Aug 27, 2021](https://hashnode.com/posts/how-to-implement-drag-and-drop-in-vanilla-js/61284dea22e1ba252a88048a/comment/61287cd522e1ba252a880977#reply-612966bcfd0bf8636d76a7ca)

Thanks! Please let me know if you have any issues!

[Vijay Thirugnanam](https://hashnode.com/@vijayst)

[Aug 28, 2021](https://hashnode.com/posts/how-to-implement-drag-and-drop-in-vanilla-js/61284dea22e1ba252a88048a/comment/61287cd522e1ba252a880977#reply-6129fdc32858872661b98f8d)

Nice it works. Here is a [CodeSandbox](https://codesandbox.io/s/drag-and-drop-obkt7). [Veronica Stork](https://hashnode.com/@veewren)

[Veronica Stork](https://hashnode.com/@veewren)

[Aug 30, 2021](https://hashnode.com/posts/how-to-implement-drag-and-drop-in-vanilla-js/61284dea22e1ba252a88048a/comment/61287cd522e1ba252a880977#reply-612c3ba0fd0bf8636d76e995)

Yay! [Vijay Thirugnanam](https://hashnode.com/@vijayst)
