Dragging text into a text box

In one text box, I can drag the text into it, and in another the text is rejected. I use Chrome and thought it would be a browser that allows you to drag and drop text. But after some googling, I see that there is javascript code to enable it. I cannot find any good resources to confirm this.

+4
source share
2 answers

If you have a webpage, you can drag and drop text from / to it. There is JavaScript code that disables this or disables image copying or right-clicking. A lot of them.

You can find more information: here or in here , depends on the script you are looking for. But in general - I would not recommend you use it (other than experience).

+4
source

Place the text in the inline element (div) after the selection using JavaScript. The drag and drop event will receive a div container, not text that you can handle.

0
source

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


All Articles