Javascript: Delete all items of select tag without for loop
- by Syom
I have a select list:
<select id="sel">
<option>text1</option>
<option>text2</option>
<option>text3</option>
<option>text4</option>
</select>
I want to delete all items, without for loop.
I tried:
document.getElementById('sel').length = 0;
But this doesn't work in some browsers.
Any ideas?
Thanks