How can a web application detect a paste event and retrieve the data to be pasted?
I would like to remove HTML content before the text is pasted into a rich text edi
For cleaning the pasted text and replacing the currently selected text with the pasted text the matter is pretty trivial:
Paste
JS:
function handlepaste(el, e) { document.execCommand('insertText', false, e.clipboardData.getData('text/plain')); e.preventDefault(); }