我有2個單選按鈕。但是當選擇一個(check1)時,我想更改span.amount html。我會怎麼做呢?更改廣播html選擇
<input type="radio" class="radio-check" name="type" id="check1" value="0" checked />
<label for="check1">$99.99</label>
<input type="radio" class="radio-check" name="type" id="check2" value="1" />
<label for="check2">None</label>
$('#check1').change(function(){
$('amount').html('$99.99'));
});
<button class="btn" type="submit">Pay <span id="amount" class="amount">$249.99</span></button>
謝謝你的幫忙!
哪裏span元素?是id ='金額'? –
發佈完整的html和javascript – Ejaz