Re: Getting IFRAME text
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Getting IFRAME text

From: Aaron Gray <ang.usenet@gmail.com>
Date: Thu Nov 10 2005 - 18:10:53 CET

Whoops, forgot the question !

I want to copy the text from a text document opened in an iframe into a
textarea at th press of a button.

> <iframe name="iframe" width="100%" height="25%" src="test1.txt">
> </iframe>
>
> one
> two
>
> <form name="form1">
> <textarea name="textarea" cols=80 rows=18>
> This is a test
> </textarea><br>
> <button name="Copy" value="Copy" OnClick="DoCopy()">Copy</button>
> </form>
>
> <script>
>
> function DoCopy()
> {
> form1.textarea.value=iframe.innerText;
> }
> </script>

I tried 'iframe.body.innerText' but that did not work.

Aaron
Received on Mon Nov 21 03:24:38 2005