Changing an html page from an iframe src

S

squirrelradio

Hi All,

I have an iframe src with an html page in it. My goal is to use
javascript from the current page to access and change a value of an
internal element from the other html page that is called within the
iframe. Is this possible? I keep searching for answers but with no
luck.

The closest I can get is to find the iframe's src, id, elements using:
myFrame = document.getElementsByTagName('iframe');
alert(myFrame[0].id);
But I can't dig down into the html, I've tried using innerHTML but that
doesn't give me the html page called into the frame.

Thanks in advance for any help.
 
M

Martin Honnen

I have an iframe src with an html page in it. My goal is to use
javascript from the current page to access and change a value of an
internal element from the other html page that is called within the
iframe. Is this possible?

Yes, use
<iframe name="iframaName" ...></iframe>
then you can access
window.frames.iframeName.document
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top