Different ways how to access iframes:
- document.getElementById(‘testiframe2′).src
- document.getElementById(‘testiframe2′).location.href
- frames['testiframe2'].src
- frames['testiframe2'].location.href
- frames[1].location.href
- frames[1].window.location.href
- frames['testiframe2'].window.location.href
- target=”testiframe2″ (loads only page2, not page1)
Check out http://www.quirksmode.org/js/iframe.html for detailed explanation.