select取值好取,赋值就相对比较麻烦一点,下面记录一下select是如何赋值的,当然也许有更好的方法
var p_num=data.ug_id;
if(p_num!=null&&p_num!=""&&p_num!=undefined){
for(var i=0;i<document.getElementById("ug_id").options.length;i++){
if(document.getElementById("ug_id").options[i].value == p_num)
{
document.getElementById("ug_id").options[i].selected=true;
break;
}
}
}