Javascript: Disable Style Pasting

355 views Asked by At

I'm building a simple WYSIWYG editor with an iframe with Desig Mode On.

My problem is that when I paste some text in the editor then it brings the style of the text too like font size, font family, color etc...

Is there any way to disable this with some predefined javascript functions? And what's the best solution for this?

Please no libraries, just pure javascript! :)

1

There are 1 answers

1
pimvdb On

I once read some editors change the focus to a regular textarea, so that the contents are pasted there (format gets lost), and then the plain text is copied into the editor.