取select控件的选中的选项的text值

来源:互联网 发布:淘宝钓鱼诈骗怎么办 编辑:程序博客网 时间:2024/05/01 13:28

<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>

原创粉丝点击