---
title: "<select>数据的动态添加和删除"
author: "chenjunxi520"
date: "2007-09-25T15:59:09Z"
tags: []
slug: "select"
draft: false
lastmod: "2007-09-25T15:59:09Z"
id: 126941
url: "https://chenjunxi520.iteye.com/blog/126941"
---

[http://topic.csdn.net/t/20050321/10/3867201.html](http://topic.csdn.net/t/20050321/10/3867201.html)#

 

&lt;script&gt;    
  function   addOption(text,value)    
  {    
  document.all.sel.options.add(&lt;nobr oncontextmenu="return false;" onmousemove="kwM(4);" id="key4" onmouseover="kwE(event,4, this);" style="COLOR: #6600ff; BORDER-BOTTOM: 0px dotted; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline" onclick="return kwC();" onmouseout="kwL(event, this);" target="\_blank"&gt;new&lt;/nobr&gt;   Option(text,value));    
  }    
  function   delOption(idx)    
  {    
  document.all.options.remove(idx);    
  }    
  &lt;/script&gt;