Sandy
Sandy

Reputation: 14125

accessing elements of child html page from parent html page?

i have a html page main.html and it has a frame frame1 in which i am showing another html page child.html so basically child.html is the child of main.html and i want to change the value of text box which is in child.html after clicking on link which is in main.html. how can i do this?

Upvotes: 0

Views: 684

Answers (1)

vilhalmer
vilhalmer

Reputation: 1159

Give the frame a name attribute, then var frameDoc = window.frames[framename].document should do the trick. You can then call any normal javascript commands like so: frameDoc.whatever

However, keep in mind that if the document inside the frame is from a different domain, you can't mess with it.

Upvotes: 1

Related Questions