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