A
Aaron Gray
Hi,
I want to access the properties of an IFrame but seem unable to get access
to the IFrames document body.
<html>
<body>
<iframe src="test.html" id="IFrame"></iframe>
</body>
<script>
var f = document.getElementById('IFrame');
f.document.body.innerHTML = "This is another test";
</script>
</html>
This writes to the main document not the IFrame.
I am doing something very basic wrong but cannot work out what. (I do know I
should be doing a open/write/close rather than an innerHTML but this is just
for testing access to the contained IFrames properties)
Help,
Aaron
I want to access the properties of an IFrame but seem unable to get access
to the IFrames document body.
<html>
<body>
<iframe src="test.html" id="IFrame"></iframe>
</body>
<script>
var f = document.getElementById('IFrame');
f.document.body.innerHTML = "This is another test";
</script>
</html>
This writes to the main document not the IFrame.
I am doing something very basic wrong but cannot work out what. (I do know I
should be doing a open/write/close rather than an innerHTML but this is just
for testing access to the contained IFrames properties)
Help,
Aaron