Jump to content

How to print something inside Div


harshpandya

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...