父窗体
<script type="text/javascript"> newwindow = window.open("b1.html","_blank"); function test(){ var mytext = document.getElementById("myinfo"); newwindow.document.getElementById("myinfo").innerText = mytext.value; } </script>
子窗体
<script type="text/javascript"> function test(){ opener.document.getElementById(‘myinfo‘).value="123"; } </script>
仅在 IE 下有效,谷歌浏览器下无效果,父子窗体互相传值。
时间: 2024-11-09 08:17:14