我想获得单选按钮而不是按钮
function getunits(val)
{
var formdata = new Object();
formdata.unit_id = val;
$.ajax({
type: "POST",
url: site_url + "welcome/unitlist",
data:formdata,
success: function(data){
var res=JSON.parse(data);
var html='';
var html2='';
var html3='';
for(var i=0; i<res.data.length ; i++){
html += "<button class='col-xs-6 btn btn-primary'>"+res.data[i].prop_unit_num+"</button></br></br>";
if(res.data[i].prop_unit_status =="sl")
{
html3 += "<button class='btn btn-success'>sale</button></br></br>"
}else if(res.data[i].prop_unit_status =="sol")
{
html3 += "<button class='btn btn-danger'>sold</button></br></br>"
}else{
html3 += "<button class='btn btn-info'> No status </button></br>"
}
html2 += "<select id='statusid"+i+"' onchange='clickokbutton(this.value,"+res.data[i].prop_unit_id+")'>";
html2 +="<option value =''>select option</option>"
for(var j=0; j<res.dropdown.length ;j++){
html2 += "<option value='"+res.dropdown[j].prop_unit_status_id+"'>"+res.dropdown[j].prop_unit_status_desc+"</option>";
}
html2 += "</select></br></br>";
if(res.data[i].prop_unit_status){
//$('#statusid"+i+" option:selected').val();
//$("#statusid"+i+"").val(res.dropdown[j].prop_unit_status_id.res.data[i].prop_unit_status);
}
$('#status').html(html2);
}
$('#units').html(html);
$('#statusdesc').html(html3);
}
});
}