这个方法虽然简单,但值得记录一下,原来的是select.options[i].value 我改成了 select.options[i].text ,根据自己需要
function set_select_checked(selectId, checkValue){
var select = document.getElementById(selectId);

for (var i = 0; i < select.options.length; i++){
if (select.options[i].text == checkValue){
select.options[i].selected = true;
break;
}
}
}

相关文章:

  • 2022-02-06
  • 2021-12-24
  • 2021-10-03
  • 2022-02-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-24
猜你喜欢
  • 2022-12-23
  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
相关资源
相似解决方案