选择下拉框是如何取选项的值?


<html>  javascript

    <head>  html

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  java

    <title>select</title>  ui

    <script type="text/javascript">  this

    

    </script>  spa

    </head>  orm

    <body id="body">  htm

    <select onchange="alert(this.options[this.selectedIndex].value);">  ip

        <option value="1">a</option>  get

       <option>b</option>  

      <option>c</option>  

    </select>  

    </body>  

</html>  




上面是个demo   

javascript:document.getElementById('reny').value=this.options[this.selectedIndex].innerHTML; 这是取选项的html

相关文章
相关标签/搜索