标签:
<!doctype html> <html> <head> <meta charset="UTF-8"> <title>父窗体</title> <style type="text/css"> html{overflow-x: hidden;} body{overflow-x: hidden;} </style> <script type="text/javascript"> function openWin() { //打开子窗体 window.open(‘a2.html‘, ‘_blank‘, ‘height=400px,width=750px‘); } </script> </head> <body> <input type="text" value="123" id="x" /> <a href="javascript:openWin()">类别2</a> </body> </html>
<!doctype html> <html> <head> <meta charset="UTF-8"> <title>子窗体</title> <script type="text/javascript"> function onClick(){ window.opener.document.getElementById(‘x‘).value = document.getElementById(‘y‘).value; window.close(); }; </script> </head> <body> <input type="text" value="1234" id="y" /> <a href="#" onclick="onClick()">修改并关闭</a> </body> </html>
在 IE、Chrome 测试通过。
标签:
原文地址:http://www.cnblogs.com/z5337/p/5261572.html