Create a Draggable Element in JavaScript

These are good suggestions, @Pythonsegmenter! I’ll revise the code as part of a future revision. Welcome to the forums btw :slight_smile:

@kirupa A newbie to JS, is it feasible to use absolute coordinates (which are relative to the container that contains the <div> as far as I understand vs. relative offsets in the script?

You should try, but the challenge is that you will need to account for offsets, scrolls, paddings, etc. either way. What you may end up with could look similar to all of the calculations in the script :smiley:

Hii, how can i drag the same elements multiple times? Please help me with this @kirupa. Its urgent.
Also, in mobile device the draggable elements are going out of the container.