firefox 對options 操做時,有一種現象不會出錯,可是沒有反映。就是:firefox
obj=document.getElementById("opt");get
alert(obj.options(obj.selectedIndex).text);io
關鍵在於括號的問題,這種代碼在IE能正常運行。FIREFOX不報錯,可是沒有結果。select
須要改成alert(obj.options[obj.selectedIndex].text);中括號便可。document