<select name="code1" onchange="getCheck()">
<option value="001">目录1</option>
<option value="002">目录2</option>
<option value="003">目录3</option>
</select>function  getCheck(){
  var s = document.form1.code1;
  var a=s.options[s.selectedIndex].text;//get 目录1
var b=document.getElementsByName("code1")[0].value; //get value 001 0r 002
alert(b);
alert(a);
}

解决方案 »

  1.   

    document.getElementById("select1").value//值
    document.getElementById("select1").text//文本
      

  2.   

    document.getElementById("select1").options[document.getElementById("select1").selectedIndex].text//文本
      

  3.   

    <select onchange="getValue(this)">
    <option value="1">a</option>
    <option value="2">b</option>
    <option value="3">c</option>
    </select>
    <script>
    function getValue(obj){
      sel   = obj;
      text  = sel.options[sel.selectedIndex].text;
      value = sel.options[sel.selectedIndex].value;
      alert(text);
      alert(value);
    }
    </script>