KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
My concept is to update the value of the text box in the main page from the iframe . This code is working in firefox , but not working in Internet Explorer and Chrome . Both main.html and frame.html are in same location . I need suggestions to make it work in all the browsers . main.html <!DOCTYPE html> <html> <head> <title> main window </title> </head> <body> Parent textbox :<input type="text" id="parentbox"></br></br></br> <iframe src="frame.html" ></iframe> </body> </html> frame.html <!DOCTYPE html> <html> <head> <title> frame window </title> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script> function PushValues() { var frame_value = document.getElementById("framebox").value; window.parent.document.getElementById("parentbox").value =frame_value; } </script> </head> <body> <input type="text" id="framebox" > <input type="button" value ="fill" onclick="PushValues()"> </body> </html>
Tags (comma-separated)
Save Edits
Cancel