Skip to content


dom操作select,增加选项


document.all(“authorid”).options.remove(0);
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:

Posted in JavaScript/DOM/XML, 技术.


No Responses (yet)

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.