Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

capture paste event / pasted html - javascript

I'd like to capture the pasted html in both mozilla and ie and then, before the paste event occurs, I'd like to modify it. Any suggestions?

like image 315
Shaokan Avatar asked Apr 22 '11 12:04

Shaokan


People also ask

How do I stop copy paste input field?

How to Disable Copy, Cut, and Paste with JavaScript/jQuery. You can allow text selection, but prevent copy and cut functions using the oncopy, oncut and onpaste event attributes. By adding these attributes into a textbox's <input> tag, you can disable cut, copy and paste features.


1 Answers

You can do it, but it's hacky. You have to essentially redirect the paste to an off-screen element. Here's my answer to a similar question: JavaScript get clipboard data on paste event (Cross browser)

like image 131
Tim Down Avatar answered Sep 22 '22 19:09

Tim Down