jQuery Example: Inserting text with drag n’ drop
If you are going to copy/paste the page for use on your computer, please remove the reference to http://skfox.com/mint and the google analytics script at the bottom. Otherwise, I get a bunch of clicks/statistics on my server that corresponds to your testing.
Alternatively, you can download all of the jQuery examples in a zip file.
I’ve got another real world example of how to use jQuery to enhance your website. A friend emailed me this morning wondering if it was possible to insert text using the click event or drag n’ drop into a textarea. jQuery and jQuery UI to the rescue! Review the screenshots below or just go check out the demo page.


Shaun,
That is a cool idea. You might want to add a .css(“cursor”, “pointer”) in there or update your CSS file with the same for the links on the left as an improvement?
Bill
Good point. Done!
Possible to do the same thing with a div? For instance, say I have selected some text within a DIV, would it be possible to paste the text over the selection doing some sort of innerHTML replace?
Is there a way to make it so when the item is dropped it will return to the next line down so the next item that is dropped will go below the first one?
Hi there,
I was wondering if you can update it with the option to drag a text at a given point in the textarea, so you can place the text between other text
Thank you!