jquery 根据后台传过来的值动态设置下拉框、单选框选中
2021-07-02 00:07
阅读:1037
标签:var jquery html attr ack ted ati blog color
jquery 根据后台传过来的值动态设置下拉框、单选框选中
1 $(function(){ 2 var sex=$("#sex").val(); 3 var marriageStatus=$("#marriageStatus").val(); 4 var education=$("#education").val(); 5 if(!isnull(sex)){ 6 //$("input:radio[name=‘sex‘][value="+sex+"]").attr(‘checked‘,‘true‘); 7 $("input:radio[name=‘sex‘][value="+sex+"]").prop(‘checked‘,‘true‘); 8 } 9 if(!isnull(marriageStatus)){ 10 //$("input:radio[name=‘marriageStatus‘][value="+marriageStatus+"]").attr(‘checked‘,‘true‘); 11 $("input:radio[name=‘marriageStatus‘][value="+marriageStatus+"]").prop(‘checked‘,‘true‘); 12 } 13 //if(!isnull(education)){ 14 // $("#education1 option[value=‘"+education+"‘]").attr("selected", true); 15 //} 16 $("#education1").val(education); 17 18 }); 19 20 男 21 女 22 23 是 24 否 25 26
jquery 根据后台传过来的值动态设置下拉框、单选框选中
标签:var jquery html attr ack ted ati blog color
原文地址:http://www.cnblogs.com/manzb/p/7131300.html
下一篇:Apache运行机制剖析
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:jquery 根据后台传过来的值动态设置下拉框、单选框选中
文章链接:http://soscw.com/essay/100549.html
文章标题:jquery 根据后台传过来的值动态设置下拉框、单选框选中
文章链接:http://soscw.com/essay/100549.html
评论
亲,登录后才可以留言!