Monday, 15 August 2011

javascript - using Rangy.js to paste plain text without HTML tags -



javascript - using Rangy.js to paste plain text without HTML tags -

i tied search , search around here , google, not found solution simple via using rangy.js or native js.

if have simple formatted text re-create like..

<div> <b>copy me (all) : soufflé chupa chups</b><br> <p style="color:#f00;"> cotton fiber candy caramels </p> </div>

how can re-create , paste plain text (without styled text) contenteditable element ?

i dont care older ies. current firefox or chrome need work.

demo : http://jsfiddle.net/72r6j/

unfortunately you'll need hacky solution. i've described here:

http://stackoverflow.com/a/3554615/96100

here's helpful in-depth reply similar question ckeditor developer:

paste plain text contenteditable div & textarea (word/excel...)

javascript jquery contenteditable paste rangy

No comments:

Post a Comment