Dragging and Dropping HTML instead of text

S

Sammy Snyders

I'm trying to drag content into a rich text control and have it render the
formatted HTML instead of dragging in the plain text of the HTML. It seems
like the javascript event.dataTransfer object can only handle text and URLs.
I was hoping someone had attempted this or could offer some guidance on
making this happen.

Thanks for your time.
 
M

Michael Baltic

You would need to grab the onmousedown event of the element you are dragging.

In the onmouseup event, if you released it over your target, then manually
pass the tag and style information.

You would have to do bounding box checks on the mouse position to determine
where the events fired.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,054
Latest member
LucyCarper

Latest Threads

Top