I have a HTML file,with a label. Somewhere inside the page in a DIV i have an iframe,which it calls a HTML file. This HTML files calls a Javascript. I want to be able to change the innerHTML of the label in my JS file. Is there any way?
Asked
Active
Viewed 373 times
-1
-
i think this will solve the problem http://stackoverflow.com/a/5924949/2654814 – Talha Büyükakkaşlar Nov 12 '13 at 13:17
-
or this http://stackoverflow.com/questions/1088544/javascript-get-element-from-within-an-iframe – Eric Beaulieu Nov 12 '13 at 13:20
-
Are the parent and iframe pages all in the same domain? – putvande Nov 12 '13 at 13:25
1 Answers
0
If I understood you, you can use this js to change html in parent page from the iframe:
window.parent.document.getElementById('label')

equinox
- 701
- 5
- 8