如何根据单选按钮选择做一个简单的if语句?jQuery单选按钮if语句
因此,如果单选按钮英寸显示,然后显示div.inchesUser(使用.show) 而厘米相反。
这就是我想要的功能做:
$('div.inchesUser').show(200);
这是我的单选按钮代码:
<form id="unitChooser">
<label>Inches or centimetres?</label>
<input class="unitSelectInches" type="radio" name="units" value="inches" />Inches
<input class="unitSelectCenti" checked="checked" type="radio" name="units" value="cms" />Centimetres
</form>
可能重复http://stackoverflow.com/questions/596351/how-can-i-get- which-radio-is-selected-via-jquery) – Barmar