jquery获取radio单选框的值

时间:2023-03-08 17:42:53
jquery获取radio单选框的值

1.获取原有单选框的值

var value=$("input[name='is_setting']:checked").val();

2.获取重选后的单选框的值

<tr>
<td>使用首末场设置:</td>
<td>
<input type="radio" name="is_setting" value="" <{if $activity.is_setting eq ""}> checked <{/if}>
onchange="readonly($(this))" >是<br>
<input type="radio" name="is_setting" value="" <{if $activity.is_setting eq ""}> checked <{/if}>
onchange="readonly($(this))" >否
</td>
</tr>
function readonly(obj){
var value = obj.val();
}