js取select的text值

来源:互联网 发布:局域网团队协作软件 编辑:程序博客网 时间:2024/05/22 01:25

<script language="javascript">
 function chk(){
  var obj = document.getElementById("sel");
  var strsel = obj.options[obj.selectedIndex].text;
  if (confirm("确定要选择"+strsel+"吗?")){

  }else{

  }
 }
</script>
<select name="sel" onchange="return chk()">
 <option value=1>a001</option>
 <option value=2>a002</option>
 <option value=3>a003</option>
</select>

原创粉丝点击