这个不用JS就可以实现。
但是要用ASP。

解决方案 »

  1.   

    <!--main.htm-->
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>main.htm</title>
    </head><frameset rows="200,*" frameborder="NO" border="1" framespacing="0">
      <frame src="a.htm" name="topFrame" scrolling="NO" noresize >
      <frame src="b.htm" name="mainFrame">
    </frameset>
    <noframes><body></body></noframes>
    </html><!--a.htm-->
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>a.htm</title>
    </head><body>
    <input type="text" name="txt1">
    </body>
    </html>
    <!--b.htm-->
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>b.htm</title>
    </head><body>
    <input type="button" value="OK" onClick="window.parent.topFrame.txt1.value='aaa'">
    </body>
    </html>