tags:

views:

40

answers:

2

i have a html page called main.html which have a frame frame1 and a text box txt and i am displaying another html page called tree.html in frame1 and i want to access data of text box in tree.html which is shown in frame1 of main.html. is it possible? if yes then how?

A: 
window.parent.document.getElementById("txt1").value

here txt1 is the id of the textbox in the parent page of the iframe.

See window.parent

rahul
A: 

I'm not sure if this would suit as you don't say why you're needing to do this but if it's to pass values entered into a textbox to a new page, couldn't you use a Query string?

Fermin