| View previous topic :: View next topic |
| Author |
Message |
clyde
Joined: 04 Mar 2008 Posts: 2
|
Posted: Tue Mar 04, 2008 4:16 am Post subject: writing to the child window |
|
|
Using document.write works fine, but I want to write to an anchor tag in the child popup window. I tried:
mychildWin.document.getElementById("childAnchor").value = "Hello";
which fails and when I popup an alert(mychildWin.document.links[0].value);
I get null. But the popup has this element.
When I use mychildWin.document.write("hello"); the hello appears fine.
What am I missing here? |
|
| Back to top |
|
 |
|
|
rangana 250+ Club

Joined: 27 Feb 2008 Posts: 271 Location: Cebu City Philippines
|
Posted: Tue Mar 04, 2008 4:59 am Post subject: Re: writing to the child window |
|
|
I suppose it should be:
| Code: |
document.getElementById('childAnchor').innerHTML = 'Hello';
|
See if it helps  |
|
| Back to top |
|
 |
clyde
Joined: 04 Mar 2008 Posts: 2
|
Posted: Thu Mar 06, 2008 4:55 am Post subject: Thanks for your help |
|
|
I am afraid it did not work either. When I check to see if the anchor is there I get null. Even tho my child window has this:
<a href="#" id="childAnchor">Hi</a> and I see the "Hi" on the page.
It claims that there is no element in mywin.document.getELementById("childAnchor");
I am confused.  |
|
| Back to top |
|
 |
|