<select id="chargeSelect" οnchange="javascript:alert(this.options[selectedItem].value)">
<option value="aaa" selected="selected">老大</option>
<option value="bbb">老二</option>
<option value="ccc">老三</option>
</select>
<script>
function submit(){
alert(document.getElementById("chargeSelect").options[document.getElementById("chargeSelect").selectedItem].value);
}
</script>
onchange事件触发弹出"aaa"。因为是当前对象所以能识别selectedItem为当前选项。
但是submit函数却不知道selectedItem是那个对象的选定项,所以在options中用了document.getElementById("chargeSelect").selectedItem。