Jump to content

Retrieving innerText from an iFrame


lilman

Recommended Posts

I have a button, and when you click it, ideally, I'd like it to show the HTML.  I have an iFrame with the id attribute valued as viewLook. So I am trying to view the HTML using a button which calls a function that has this code:

 

var obj=document.getElementById("viewLook").contentWindow.document.innerText;

document.write(obj);

 

However, it always comes back undefined.  Any help would be great.

Link to comment
https://forums.phpfreaks.com/topic/65255-retrieving-innertext-from-an-iframe/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.