html代码:

<select name="test" >
  <option value="0">请选择</option>
  <option value="1">test1</option>
  <option value="2">test2</option>
</select>

 jq代码:

//获取select被选中的value
$("select[name='test']").val();
//获取select被选中的text
$("select[name='test'] option:selected").text();

相关文章:

  • 2021-09-09
  • 2021-11-21
猜你喜欢
  • 2021-12-22
  • 2021-07-24
  • 2021-12-10
  • 2021-11-17
  • 2021-11-21
  • 2021-11-21
相关资源
相似解决方案