johnsmith153 Posted October 8, 2008 Share Posted October 8, 2008 I have an iframe on a page. Just like I can use window.document etc to reference a window I have opened, and also to reference the parent from a window, can I do this with an iframe? I just want to change the .innerHTML of a div. parent.document.divname.innerHTML= sounds good, but unfortunately not. Link to comment https://forums.phpfreaks.com/topic/127607-reference-in-and-out-of-iframe/ Share on other sites More sharing options...
F1Fan Posted October 8, 2008 Share Posted October 8, 2008 window.parent.getElementById('yourdivname').innerHTML = 'whatever'; Link to comment https://forums.phpfreaks.com/topic/127607-reference-in-and-out-of-iframe/#findComment-660248 Share on other sites More sharing options...
johnsmith153 Posted October 8, 2008 Author Share Posted October 8, 2008 It doesnt work, but: window.parent.document.getElementById('yourdivname').innerHTML = 'whatever'; does. Thanks anyway. Link to comment https://forums.phpfreaks.com/topic/127607-reference-in-and-out-of-iframe/#findComment-660319 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.