JQuery: Drag & Drop Image In the text box place the <img> tag in the text

Looking at using jQuery to allow the user to drag the thumbnail of an image from a column of images into the text area of ​​the form. When the user drags the image into the text area, the full img tag is added to the text field, as the form supports HTML insertion (part of the CMS).

Ideally, the added text would look like this:

<img src="the src attribute of the image that was dragged in" alt="the alt tag of the image that was dragged in" />

The image column itself will be populated with a dynamic image list, and it will contain a simple photo upload form that will be updated using AJAX. This way, users can easily upload a photo and then drag it into their blog / textarea field. I know how to make this part, not the drag part!

Thanks in advance.

Scott

+3
source share
1 answer

perhaps this article is native drag and drop

+2
source

Source: https://habr.com/ru/post/1777251/


All Articles