ITeye博客

js如何获取本页中select选中的值!

summerlin · 2015-05-18 10:57 · js · 编程语言 · Markdown

<html>  

 <head>  

  <script type="text/javascript">  

     function okIS(val)     

  {     

    //String  n=this.options[selectedIndex].value;      

   alert(val);  

  }     

    </script>     

</head>  

<body>     

  <select   name="sel"   onchange="okIS(this.options[selectedIndex].value)">     

  <option value="1"/>a 

  <option value="2"/>b  

<option value="3"/>c  

 <option value="4"/>d 

</select>   

</body>  

</html>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。