<fieldset style="width:240 px">
<legend>Food order</legend>
<fieldset style="width:240 px">
<legend>Nasi Lemak</legend> \t
<p>
<input type="radio" name="j" value="2"
onclick="calculate();" />
<label for='small' class="inlinelabel">
Small</label>
(RM2)
</p>
<p>
<input type="radio" name="j" value="3"
onclick="calculate();" />
<label for='regular' class="inlinelabel">
Regular</label>
(RM3)
</p>
<p>
<input type="radio" name="j" value="4"
onclick="calculate();" />
<label for='large' class="inlinelabel">
Large</label>
(RM4)
</p>
<tr>
<td>Price = </td>
<td><output type="number" name="price" id="output"></output></td>
</tr>
</fieldset>
<script type="text/javascript">
calculate()
{
}
</script>
有誰知道如何輸出單擊單選按鈕時的價格是多少?比方說,如果我選擇Small,那麼它將顯示輸出Rm2 ...例如Price = Rm 2 ....我不知道如何繼續它...如果有人幫我解決這個問題,我將非常感激。 .thanks〜
你不會是AB le只用html來做到這一點。這將需要一些JavaScript – pstenstrm 2014-11-08 12:20:02
但在下面我有添加<腳本類型=「文/ JavaScript的」> ... HTML與把計算裏面的javascript – 2014-11-08 12:26:52