父窗口
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>无标题文档</title>
<script language="javascript">
function openSub()
{
window.open("新建 文本文档 (2).html",null,"height=200,width=400,status=yes,toolbar=no,menubar=no,location=no");
}
</script>
</head>
<body>
<form name="frm0">
<input type="text" id="txtId" />
<input type="button" οnclick="openSub();" value="打开子窗口" />
</form>
</body>
</html>
子窗口
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2123" />
<title>无标题文档</title>
<script language="javascript">
function setValue()
{
window.opener.document.getElementById("txtId").value=window.self.document.getElementById("dd").value;
window.close();
}
</script>
</head>
<body>
<form name="frm">
我是子窗口
<input type="button" οnclick="setValue();" value="赋值"/>
<input type="text" id="dd" value="赋值"/>
</form>
</body>
</html>