标签:
通过window.open
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> </head> <body> <div id="first"> <input type="text" name="maintext" id="test"> <input type="button" onclick="window.open(‘second.html‘)" value="确定"> </div> </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body> <script language="javascript" > //opener可操作父窗口的html var parentText = window.opener.document.getElementById("test").value;//捕获父级元素 document.write(parentText); window.opener.close()//关闭父级窗口 </script> </body> </html>
标签:
原文地址:http://www.cnblogs.com/flyings/p/5428756.html