错误写法(但是网上都是这样写,无语):

 $("#s_province").find("option[text='天津市']").attr("selected","selected");

 

正确的写法:

$("#s_province option:contains('天津市')").attr("selected", true);

相关文章:

  • 2021-11-21
  • 2021-12-10
  • 2021-10-25
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2021-10-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-26
  • 2021-10-04
  • 2021-09-18
  • 2022-12-23
相关资源
相似解决方案