110,538
社区成员
发帖
与我相关
我的任务
分享
function opendialog1()
{
var someValue=window.showModalDialog("b.html","","dialogWidth=500px;
"dialogHeight=500px;status=no;help=no;scrollbars=no");
document.form1.p1t.value=someValue;
}
HTML
<form name="form1" action="#">
<input type="text" name="p1t">
<input type="button" value="打开对话框" onclick="opendialog1()">
</form>
b.html 子页面
JS
function a(wname)
{
parent.window.returnValue=wname; //父窗口就是上一个页面
window.close();
}
HTML
<form name="form1" action="">
<input type="button" value="传值" onclick="return a('hello')">
</form>