您的位置:首页 > Web前端 > JQuery

用jquery方法操作radio使其默认选项是否

2018-10-12 14:06 330 查看

<tr>
<th>是否映射:</th>
<td>
<input type="radio" name="sfys" class="radio" id="yes"
value="1"/><label for="yes">是</label>
<input type="radio" name="sfys" class="radio" id="no"
value="0"/><label for="no">否</label>
</td>
</tr>

用jquery方法操作,使其默认选项是否.

$(function () {
var sfys = "<#if os??&&os.sfys??>${os.sfys}</#if>";
if (sfys == '1') {
$("#yes").attr('checked', 'checked');
} else {
$("#no").attr('checked', 'checked');
}
});

您可能感兴趣的文章:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: