日期:2014-05-17 浏览次数:20961 次
<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>