【发布时间】:2010-05-18 16:14:13
【问题描述】:
我有一个选择列表:
<select id="sel">
<option>text1</option>
<option>text2</option>
<option>text3</option>
<option>text4</option>
</select>
我想删除所有项目,没有for 循环。
我试过了:
document.getElementById('sel').length = 0;
但这在某些浏览器中不起作用。
有什么想法吗?
谢谢
【问题讨论】:
标签: javascript select collections