Does the event occur after insertion?

Possible duplicate:
Detect nested text with Ctrl + V or right click β†’ paste

Now I am coding a js editor. I want to do something (detect pasted text, etc.) Immediately after the paste.

+4
source share
1 answer

Here is an example of insert processing:

http://www.quirksmode.org/dom/events/tests/cutcopypaste.html

It is supported in many browsers, but not 100% - see this table for compatibility: http://www.quirksmode.org/dom/events/cutcopypaste.html

You can also do without having to insert in some browsers:

  • Remembering the full contents of a form field at some time

  • Timeout Setting

  • In the timeout, re-enter the contents of the field, compare with the previous contents and detect the changes. Pour, rinse, repeat

+2
source

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


All Articles