JavaScript/DOM/XML & 技术 08 Oct 2006 01:25 pm

dom操作select,增加选项

  1. document.all("authorid").options.remove(0);
  2.      document.all("authorid").options.add(new Option(name,value));

下面的例子给出了一个完整的演示。由于看例子比我解说更容易理解,所以我就废话少说,把代码贴出,希望对大家需要的网友有一点帮助。





First Sample:
All items will change After you Selected!

Second Sample:
You selected Item in Main Select will change the Sub select Content!

Main Select:

Sub Select:

Trackback This Post | Subscribe to the comments through RSS Feed

Leave a Reply