日期:2014-05-16 浏览次数:20394 次
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>test</title> </head> <body> <form name="form1"> <input type="text" name="text1" /> <input type="button" value="submit" name="submit" onclick="submitIt();"/> </form> <script type="text/javascript"> function submitIt(){ var text2=parent.frames["iframe1"].document.forms["form2"].text2; var text1=document.forms[0].text1; text2.value=text1.value; } </script> </body> </html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>2</title> </head> <body> <form name="form2"> 用户名: <input type="text" name="text2" /> </form> </body> </html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>3</title> </head> <body> <iframe src="1.html" name="iframe1"></iframe> <iframe src="2.html" name="iframe2"></iframe> </body> </html>