HTML Code to change iFrame source?

Watchmaker

New member
Hi,

I have the following code: <a href="#" OnClick="document.getElementById('chgMe').src='banana.html'">Banana</a>

Now this code works great when places on my index.html page so that it can change the source page for one of the iframes on the index.html page. My problem is that I want to place that code IN an iframe, so that iframe can have a link that changes the source page for the other iframe. Both of iframes are on the same page, so basically I need iFrameA from index.html, to have a link in it's content that changes the source page of iFrameB which is also in the index.html page.

Any HTML/Javascript/PHP code would be of great help, I'm really getting desperate here, so please help... Thanks!
<a href="#" OnClick="document.getElementById
('chgMe').src='banana.jpg'">Banani</a>

^ That's the code, sorry it got shortened the first time.
 
Back
Top