我需要将计算的会员费添加到我的业余无线电俱乐部的会员申请页面。从我读到的内容来看,我需要使用 ID。但我仍然无法让它工作。下面是包含 javascript 的页面的一部分。任何帮助是极大的赞赏。
<tr>
<td width="5%"> </td>
<td class="bosytext" width="15%">Membership Period</td>
<td class="bosytext" width="75%"><input type="number" name="membershipterm" id="term" required="required"> $22 for single year membership/ $20 per multi-year membership</td>
<td width="5%"> </td>
</tr>
<tr>
<td width="5%"> </td>
<td width="15%">Fee</td>
<script>
var fee;
var term;
if term = 1 {
(fee = 22;
} else {
fee = 20;
}
//calculates membership fee
var totalFee = (fee * term)
// outputs calced membership fee to html
document.getElementById('totalFee')
</script>
<td width="75%">id="totalFee</td>
<td width="5%"> </td>
</tr>
慕桂英546537
子衿沉夜
相关分类