opener:对打开当前窗口的window对象的引用,如果当前窗口已被用户打开,则opener的值为null.
self:自引用属性,是对当前window对象的应用,与window属性同义.
<html>
<body>
<form. name=form1>
<input type=text name=inpu >
<input type=button >
</form>
</body>
</html>
--------------------------------
back2opener.html
--------------------------------
<html>
<body>
<form. name=form1>
<input type=text name=inpu >
<a class=under href=# >添加</a>
</form>
</body>
</html>
window.opener 返回的是创建当前窗口的那个窗口的引用,比如点击了a.htm上的一个链接而打开了
b.htm,然后我们打算在b.htm上输入一个值然后赋予a.htm上的一个id为“name”的textbox中,就可以
写为:
window.opener.document.getElementById("name").value = "输入的数据";