drag & drop img from a zone to another through js code

Hi, I have a code working more or less on my local browser, and would like to adapt to wix.
(I am not regular coding, just familiar)
an img would be dragged from a zone and dropped to another zone
I found I could create index.js in the Public section … but error occurs on ‘document’ that refear to the image I stored in the id global variable. any help? thank you

Corvid understands all of Javascript, except for anything that accesses the DOM. This keeps the user from inadvertently “breaking” something. Accessing document elements such as div, span, button, etc is off-limits. The way to access elements on the page is only through $w.

One small exception is the $w.HtmlComponent (which is based on an iFrame). This element was designed to contain vanilla HTML and it works just fine. You just can’t try to trick it by using parent, window, top, etc. Same goes with the Javascript evaluate() function. It is sandboxed and does not allow access to the DOM.

See the article Corvid Javascript Support for more information.

Just to follow up on the original question - how can one use the drag and drop functionality in Corvid/Velo?