Inserting text into an editable IFRAME at the caret position (IE)
问题 I'm struggling with an actually straighforward problem: In Internet Explorer I want to insert plain text at the current caret position. This works really fine for simple TEXTAREA elements but it doesn't entirely work for editable IFRAMEs, which is what I have. In the script I use I am creating a TextRange object from the document of the IFRAME which I use to paste the text as HTML at the cursor position. <iframe id="editable"> <html> <body> Some really boring text. </body> </html> </iframe>