layui radio 根據獲取的到值選中

<input type="radio" name="lwkg" value="1" title="開" lay-filter="lwkg">
<input type="radio" name="lwkg" value="0" title="關" lay-filter="lwkg">jquery

 

layui.use(['form', 'layedit', 'laydate'], function () {
var $ = layui.jquery, form = layui.form;ajax

$.ajax({
type: "POST",
url: "../Method/GetParamter.ashx?rnd=" + Math.random(),
dataType: "text",
success: function (data) {
var s = eval(data);
if (s.length > 0) {
var o = s[0];dom

var lwjs_PD = o.lwjs_PD;
$("input[name=lwkg][value=1]").attr("checked", lwjs_PD == 1 ? true : false);
$("input[name=lwkg][value=0]").attr("checked", lwjs_PD == 0 ? true : false);ui

 

form.render(); //更新所有


}
}
});


});url

相關文章
相關標籤/搜索