Drag and Drop in Javascript

Опубликовано: 15 Май 2026
на канале: aditya kumar
164
6

In this video, we are going to learn how to create drag and drop in javascript. We have implemented drag and drop API from javascript.


it's worth noting that in most browsers, text selections, images, and links are draggable by default. For example, if you drag a link on a web page you will see a small box with a title and URL. You can drop this box on the address bar or the desktop to create a shortcut or to navigate to the link. To make other types of content draggable you need to use the HTML5 Drag and Drop APIs.

To make content draggable we essentially need to add draggable true properties to the element that we want to drag.
Once we add that javascript give us some other event listener like.
dragstart
drag
dragenter
dragleave
drop
dragend
we are going to use these events to control our draggable element on the screen.




Follow Me
  / thisisadityak  
  / dev_adityakmr  
https://github.com/adityakmr7

Support Channel
  / adityakmr  
https://www.buymeacoffee.com/adityakmr

Products I Use:
MacBook Air: https://amzn.to/3qYBLpL
iPhone: https://amzn.to/3H3NCs0
Mic: https://amzn.to/3FTwJPu
Screen: https://amzn.to/32ufnLo




Articles
https://adityakmr.hashnode.dev/primit...
https://adityakmr.hashnode.dev/contai...

#draganddrop #javascript #javascriptturorial #tutorial #project #js #jstutorial