1
如何通过名称获得iCheck电台价值,如$("input[type=radio][name=test]").val()
?似乎它不起作用。请参阅JSFiddle。Javascript:通过名称获得iCheck电台价值
HTML
<div class="i-checks"><label> <input type="radio" checked="" value="a" name="test"> a </label></div>
<div class="i-checks"><label> <input type="radio" value="b" name="test"> b </label></div>
<div class="i-checks"><label> <input type="radio" value="c" name="test"> c </label></div>
The <span id='outputbythis' style='color:green'></span> is checked by $(this).val()
<br>
The <span id='outputbyname' style='color:red'></span> is checked by $("input[type=radio][name=test]").val()
JS
如何通过名称获得I检查收音机的价值? – WCMC
查看我的回复,我更新了 – Klajdi
谢谢!真的很难找到一个自学者。我的意思是我无法理解和意识到,有时''(“input [type = radio] [name = test]”)'有时会在'$(“input [type = radio] [name = test]”)改为'$(“input [type = radio] [name = test]:checked”)。val()'。 – WCMC