I have an iframe in my page and how can i get a the value of t text box in the frame from my parent page on a button click?
here is my code
<div>
<iframe src="test.html" >
<input type=text id="parent_text">
<input type="button">
</div>
here is d test.html
<input type="text" id="frame_text">
thanks
Something like this:
First you get the the iframe. Then you get the first valid dom document from inside the iframe.
And finaly get the input box.
Here is parent page code (I mean main page call to
iframe
):If you have Div/ input as follows in one Iframe
Then you can find the text of those Div using the following code
I hope this will help someone.