由于某种原因,这段代码在 Safari 中不起作用,有人知道为什么吗?第一个单选框很好,但是一旦我检查了第二个单选框,它就不会计算。http://jsfiddle.net/njyEP/
谢谢
Javascript:
$("input[type=radio][name=radio],select").change(function() {
var radio = parseFloat($('#radio:checked').attr("tvalue"));
var select = parseFloat($('#select').val());
$('#Total').text((select * radio));
});
html
<form method="post" action="">
<select name="select" id="select" name="select"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option>
</select>
<div id="radioButtons"><input type="radio" class="multi" name="radio" id="radio" ivalue="1" tvalue="275" value="1185">Earlybird 1 Day Registration $275<br>
<input type="radio" class="multi" name="radio" id="radio" ivalue="2" tvalue="475" value="1186">Earlybird 2 Day Registration $475<br>
<input type="radio" class="multi" name="radio" id="radio" ivalue="3" tvalue="625" value="1187">Earlybird 3 Day Registration (all three days) $625<br>
</div><div id="checkBoxes">
<br><label id="Total"></label><br></form>