harshpandya Posted March 10, 2008 Share Posted March 10, 2008 If i write this codewindow.parent.document.getElementById("div3").style.display = "block"it displays the DivNow i want to print some values inside the divCode:window.parent.document.getElementById('div3').innerHTML = 'X = '+ X + ' Y = ' + Y;Why its not working?NOTE::::::Here my iframe is a child and when i click on iframe the variables XY needs to print inside Parent Div.what should i do??Help Link to comment Share on other sites More sharing options...
justsomeguy Posted March 10, 2008 Share Posted March 10, 2008 This question was already asked here:http://w3schools.invisionzone.com/index.php?showtopic=18215The answer isn't going to change. Link to comment Share on other sites More sharing options...
jeffman Posted March 10, 2008 Share Posted March 10, 2008 As a test, in your HTML markup, where you create the div, give it some text content. Then, put this line in your script: alert(window.parent.document.getElementById('div3').innerHTML); If the alert doesn't reproduce what's already in the iFrame, then you are using an incorrect reference. Just knowing that will get you started.You could also help yourself by developing in Firefox and using your DOM inspector.or, as someone said before, you could paste your code here, or just give us a link, and someone might look at it and see what's going wrong. Link to comment Share on other sites More sharing options...
harshpandya Posted March 10, 2008 Author Share Posted March 10, 2008 I figured it out --- thanks anyway though...my computer was acting wired - because i have not restart it since few weeks or soHahhah Funny.... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.