js下拉列表選中


 var monthobj = document.getElementById("pid");
// for(var i=0; i<monthobj.options.length; i++) {
// console.log(monthobj.options[i].value);
// if (monthobj.options[i].value == 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');


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM