从下拉列表中删除选项

  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function removeOption()
  5. {
  6. var x=document.getElementById("mySelect")
  7. x.remove(x.selectedIndex)
  8. }
  9. </script>
  10. </head>
  11. <body>
  12.  
  13. <form>
  14. <select id="mySelect">
  15. <option>苹果</option>
  16. <option>桃子</option>
  17. <option>香蕉</option>
  18. <option>桔子</option>
  19. </select>
  20. <input type="button" onclick="removeOption()" value="删除被选的选项">
  21. </form>
  22.  
  23. </body>
  24. </html>