前台页面:<input type='radio' name='sex'>
$.each(data,function(name,value){
$(":radio[name='"+name+"'][value='" + value + "']").prop("checked","checked");
})
获取选中的值:
var sex = $('nput[name="sex"]:checked ').val();
前台页面:<input type='radio' name='sex'>
$.each(data,function(name,value){
$(":radio[name='"+name+"'][value='" + value + "']").prop("checked","checked");
})
获取选中的值:
var sex = $('nput[name="sex"]:checked ').val();