nlbnick

JS获取select下拉框选中的value或者其name

举例:
<select class="js-example-basic-single js-states" style="width: 300px" name="hid" id="hid">
   
$("#hid option:checked").text()      //这是获取下拉框显示出来的值 【hid为select标签的id】
$("#hid option:checked").val()       //获取下拉框的value     
 
当然还有很多方式,就是jquery的选择器,在这里就介绍这一种。

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-03-29
  • 1970-01-01
  • 2022-12-23
  • 2021-12-10
  • 2021-12-10
  • 2021-06-19
  • 2021-08-09
猜你喜欢
  • 2021-12-26
  • 2021-12-10
  • 2022-12-23
  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
相关资源
相似解决方案