i have a select tag, with some options
<select id="sel">
<option>text1</option>
<option>text2</option>
<option>text3</option>
<option>text4</option>
</select>
i want to delete all options except second, i.e i want to get
<select id="sel">
<option>text2</option>
</select>
i think it must looks something like this
document.getElementById('sel').options.length= 0;
but it deletes all list, so could you help me.
thanks
You should be able to modify this to do as you want.