1.html:
<form name="form1">
<textarea name="txt1"></textarea>
<input type="button" value="open" onclick="openWin()">
</form>
<script language="javascript">
function openWin()
{
  showModalDialog("2.html",new Array(window),"DialogHeight=200px;DialogWidth=200px;");
}
</script>
2.html:
<a href="#" onclick="javascript:window.dialogArguments[0].document.form1.txt1.value='1231';">add</a>

解决方案 »

  1.   

    <script>
    function open_win() {
    var aWin=open('about:blank','new_win','');
    aWin.document.write("<a id=\"a1\" href=\"http://www.csdn.net\" onClick=\"window.opener.form1.tt1.value=window.opener.form1.tt1.value + '这是打开的窗口点击后加进来的话!'\">打开csdn.net的同时修改打开页面内的一个form里的Textarea里的值!</a>");
    }
    open_win();
    </script><body>
    <form id="form1" name="form1">
    <textarea id="tt1" name="tt1" cols=60 rows=20>这里有一句内容,点击打开页面的连接以后,这里将会增加一句话!     </textarea>
    </form>
    </body>
      

  2.   

    哈哈,对不起,我用的是showModalDialog,请忽略我的帖子,:-)
      

  3.   

    saucer(思归)的效果是正确的,但我想在window.open开的窗口里进行操作(给分)
    skyover(嘻哈呵嘿)的code我没试出来..
      

  4.   

    shoule be similar, change in
    1.html
    showModalDialog("2.html",new Array(window),"DialogHeight=200px;DialogWidth=200px;");
    ==>
    window.open("2.html","somename","width=300,height=200");2.html:
    <a href="#" onclick="javascript:window.dialogArguments[0].document.form1.txt1.value='1231';">add</a>
    ===>
    <a href="#" onclick="javascript:window.opener.document.form1.txt1.value='1231';">add</a>