在一个select中有<option value="2">2</option>这样的一个选项,如何得到选定item的value呢?

解决方案 »

  1.   

    <select id="Select1" onchange=alert(this.value)>
            <option selected="selected" value=1>aaa</option>
            <option  value=2>bbb</option>
            <option  value=3>ccc</option>
    </select>
      

  2.   

    在onChange中
    var Listbox = document.getElementById("name"); //name是你select的name
    var text = CurrencyListbox.options[Currcyid].text; //获得选项内容
    var id = CurrencyListbox.options[Currcyid].value; //获得选项id
      

  3.   

    不好意思上面的错了
    在onChange中 
    var id = fm.Currency.value; //获得选项id
    var Listbox = document.getElementById("name"); //name是你select的name 
    var text = Listbox .options[id].text; //获得选项内容