Insert plain text into iframe? not .htm file

Is it possible to insert plain text into an iframe? trying to make a small text editor using this tutorial

http://www.devarticles.com/c/a/HTML/Building-a-WYSIWYG-HTML-Editor-Part-1/

and want to have some text in the iframe that I can change. but I don't want to receive this text from any external html file.

is it possible to insert text into an iframe like in textarea? thank

+2


source to share


3 answers


An iFrame is used to display content from another page, so you have to put the text on another page and then display that page in an iframe.



If the page that frames has a text box on it, then yes, you will be able to type into the text area from the first page that is iframing the page with the text box on it.

+1


source


Assuming your iframe is named "Editor", you can enter text into it:



<script language="javascript">var text_to_edit = "some text"; window.frames['Editor'].document.body.innerHTML = text_to_edit; </script>

      

+1


source


Try to get the iframe document and then "document.write".

0


source







All Articles