var monthobj = document.getElementById("pid");
// for(var i=0; i//console.log(monthobj.options[i].value);
//if (monthobj.options[i].value =https://www.it610.com/article/= vals) {
//monthobj.options[i].selected = true;
//break;
//}
// }
// $('#pid option').each(function(){
//var self = $(this);
//var selfVal = self.val();
//if(selfVal == vals){
//self.attr('selected','true');
////self.selected = true;
//}else{
//console.log(5);
//}
////if(selfVal == vals) self.attr('selected' , 'true');
【js下拉列表选中】转载于:https://www.cnblogs.com/isuansuan/p/10640576.html