I have a div with contexteditable set to true and with a special google web font set. Now, when the user pastes in text from a different source which has a different font, it shows up in that different font in my div, how can I change the font to the default font of my div when the text is pasted in?
jQuery would be best, but, I don’t like plugins much.
Updated link: http://jsfiddle.net/Kai/vkbuq/
It strips out the font-family styling included with the paste. Obviously you could also explicitly change it to something else, but removing it altogether forces it to inherit whatever font you have styled on the doc/div:
Vanilla JS:
jQuery: