Reputation: 1460
I have two pages "childpage" and "pageforIFrame". here childpage is the child of a master page "Master1". on the child page I have an IFRAME, its src is pageforIFrame. On the button click of pageforIFrame button i want the label inside the master page. Is it possible?
Thanks in advance.....
Upvotes: 0
Views: 2429
Reputation: 1242
try to write this
$("#IfrmaeID").contents().find("#ElementID")
alert this and if this give object you can assign any value.
Upvotes: 1
Reputation: 1038710
Is it possible?
Yes, if the two applications are hosted on the same domain. You could access the parent DOM from the iframe like this:
window.parent.document.getElementById...
Upvotes: 1
Reputation: 5989
You can access the parent page from the iframe like this. considering your myLabel has id="myLabel" place this code in your iframe script tag for click of button
alert(top.document.getElementById('myLabel'));
and chagne the label
top.document.getElementById('myLabel').innerHTML = "Hello";
Upvotes: 1