真是醉了,网上搜了很久,全都是千篇一律的。

大家都拷贝来拷贝去,全是错的。

 

通过text值来设置select选定

$("#CompanyID").find("option:contains('a')").attr("selected", true);

 

遍历select

$("#feedbackReason option").each(function() {
    console.log($(this).val());
});

 

获取选项个数

$("#feedbackReason option").length;

 

相关文章:

  • 2021-08-31
  • 2021-07-05
  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
  • 2022-12-23
  • 2021-10-25
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-20
  • 2022-12-23
  • 2021-12-23
相关资源
相似解决方案