radio后台数据回显

radio


方式一 :
var yourVal = "1"; // or 2,3
$("input[name='level']").each(function(index) {
    if ($("input[name='level']").get(index).value == yourVal) {
        $("input[name='level']").get(index).checked = true;
    }
});
方式二 :
 $(":radio[name='projectRoleName'][value='" + data.AUDIT_PROJECT_ROLE + "']").prop("checked", "checked");
原文地址:https://www.cnblogs.com/liclBlog/p/15349577.html