81,094
社区成员
发帖
与我相关
我的任务
分享
<table>
<tr>
<td>
<input name="bay" type="checkbox" value="100">100元月卡
<input name="bay" type="checkbox" value="200">200元季卡
<input name="bay" type="checkbox" value="300">300元半年卡
<input name="bay" type="checkbox" value="400">400年卡
</td>
</tr>
<tr>
<td>
<a href="https://www.abc.com/ok.htm?Email=123@qq.com&sms=123&pay=100&title=付款100元,购买100元月卡" target="_blank">付款</a>
</td>
</tr>
</table>
<script>
function changeHref(obj) {
var target = document.getElementById("aPay"); // 查找目标对象
target.href = "https://www.abc.com/ok.htm?pay=" + obj.value; // 修改A标签
}
</script>
<table>
<tr>
<td>
<input name="bay" type="checkbox" value="100" onclick="changeHref(this);">100元月卡
<input name="bay" type="checkbox" value="200" onclick="changeHref(this);">200元季卡
<input name="bay" type="checkbox" value="300" onclick="changeHref(this);">300元半年卡
<input name="bay" type="checkbox" value="400" onclick="changeHref(this);">400年卡
</td>
</tr>
<tr>
<td>
<a id="aPay" href="https://www.abc.com/ok.htm?Email=123@qq.com&sms=123&pay=100&title=付款100元,购买100元月卡" target="_blank">付款</a>
</td>
</tr>
</table>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function change(obj){
document.getElementById("theA").src="https://www.abc.com/ok.htm?Email=123@qq.com&sms=123&pay="+obj.value+"&title="+obj.title;
}
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<table>
<tr>
<td>
<input name="bay" type="radio" value="100" onclick="change(this)" title="100元月卡">100元月卡
<input name="bay" type="radio" value="200" onclick="change(this)" title="200元月卡">200元季卡
<input name="bay" type="radio" value="300" onclick="change(this)" title="300元月卡">300元半年卡
<input name="bay" type="radio" value="400" onclick="change(this)" title="400元月卡">400年卡
</td>
</tr>
<tr>
<td>
<a id="theA" href="https://www.abc.com/ok.htm?Email=123@qq.com&sms=123&pay=100&title=付款100元,购买100元月卡" target="_blank">付款</a>
</td>
</tr>
</table>
</form>
</body>
</html>