62,046
社区成员
发帖
与我相关
我的任务
分享
window.opener.document.getElementById("textbox1").value="";
window.opener.document.getElementById("button1").clcick();
<script>
function OpenWin()
{
window.open("b.htm");
}
function checkForm()
{
alert("点了A页面的button");
return true;
}
</script>
<form name="form1" onsubmit="return checkForm();">
<input type="button" value="打开新页面" onclick="OpenWin();">
<input type="text" value="" id="tb" name="tb">
<input type="submit" value="要执行的BUTTON" id="btn" name="btn">
</form>
<script>
function TranValue()
{
window.opener.document.getElementById("tb").value=document.getElementById("tb1").value;
window.opener.document.getElementById("btn").click();
window.close();
}
</script>
<input type="button" value="传值回A页面并执行A的CLICK事件" onclick="TranValue();">
<input type="text" value="123123123123" id="tb1" name="tb1">