更新时间:2022-11-10 20:26:36
如果您有这样的HTML:
If you have HTML that looks like this:
<input type='radio' name='choices' value='1'>
<input type='radio' name='choices' value='2'>
<input type='radio' name='choices' value='3'>
<input type='radio' name='choices' value='4'>
<input type='radio' name='choices' value='5'>
您将通过以下方式获得选定的单选值:
You would get the selected radio value with this:
$("input:radio[name='choices']:checked").val();