<html><head><script type="text/javascript">function removeOption(){var x=document.getElementById("mySelect")x.remove(x.selectedIndex)//這里的remove,js中沒有這個方法吧,我只知道jQuery有,而且參數還只是個索引?請問為什么可以這么用呢,哪有這個語法的講解?感謝~}</script></head><body><form><select id="mySelect"><option>蘋果</option><option>桃子</option><option>香蕉</option><option>桔子</option></select><input type="button" onclick="removeOption()" value="刪除被選的選項"></form></body></html>
關于這段js的疑問
飲歌長嘯
2018-09-06 09:09:44