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. Quote Link to comment Share on other sites More sharing options...
F1Fan Posted October 8, 2008 Share Posted October 8, 2008 window.parent.getElementById('yourdivname').innerHTML = 'whatever'; Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.