Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to refer to elements within an iFrame in Safari 1

Status
Not open for further replies.

jsteph

Technical User
Oct 24, 2002
2,562
US
Hi all,
I have a bit of javascript on a page which contains an iFrame. In this iFrame there are different html elements. In IE 7, this javascript works fine:

var fra = document.frames('framain').document
fra.getElementById('img1').style.width='1500px'

I've tried what seems like dozens of different syntaxes to get this to work in Safari (3.1.1) and nothing works. Can anyone help with this?
Thanks,
--Jim
 
Woohoo!!
Thanks Dan, that worked!
Code:
//For Safari
var fra = document.getElementById('framain')
var doc = fra.contentDocument
doc.getElementById('img1').style.width='1500px'
--Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top