页面1
<html> <head> <script type="text/javascript"> function getMsg(){ var el = document.getElementById("msg"); var txt = document.frames['inside'].document.getElementById('txts'); txt.value = el.value; } </script> </head> <body> <input type="text" id="msg" /> <input type="button" onclick="getMsg()" value="button" /><br/> <iframe name="inside" id="inside" src="1.html" cols="30%,*" height=600 width=1100 scrolling=no frameborder=yes> </iframe> </body> </html>
页面2
<html> <head> <script type="text/javascript"> function getMsgs(){ var el = parent.document.getElementById("msg"); var txt = document.getElementById("txts"); el.value = txt.value; } </script> </head> <body> <input type="text" id="txts" /> <input type="button" value="button" onclick="getMsgs()" </body> </html>
iframe参数的调用
本文由 admin 创作,采用 知识共享署名4.0
国际许可协议进行许可
本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名
最后编辑时间为:2022-08-09 21:21:24