<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
<script type="text/javascript">
function SendICBCPay()
{
var btnSendICBC =document.getElementById("frmICBCPay").document.getElementById("btnSend");//.all["btnSend"];
alert(btnSendICBC);
//.click();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="Button1" type="button" value="支付" onclick="SendICBCPay()" />
<iframe name="frmICBCPay" border="0" src="WebPay/Default.aspx" />
</div>
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="btnSend" type="submit" value=" 提 交 订 单 "><br />
</div>
</form>
</body>
</html>以上是取Iframe中的btnSend然后要执行他的点击事件
但我取不到那个btnSend
大家看哪里出错了谢谢
alert(btnSendICBC);
window.frames["frmICBCPay"].document.getElementById("btnSend");
btnSendICBC =btnSendICBC.getElementById("btnSend");
试试看
btnSend 只是一个提交按钮,你取他的值何用?或者可以用asp.net服务器控件实现
//document.getElementById("frmICBCPay").document.getElementById("btnSend");//.all["btnSend"];
alert(btnSendICBC.id);