how delete all options except second in javascript
<p>i have a select tag, with some options</p>

<pre><code>&lt;select id="sel"&gt;
     &lt;option&gt;text1&lt;/option&gt;
     &lt;option&gt;text2&lt;/option&gt;
     &lt;option&gt;text3&lt;/option&gt;
     &lt;option&gt;text4&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>i want to delete all options except second, i.e i want to get</p>

<pre><code>&lt;select id="sel"&gt;
     &lt;option&gt;text2&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>i think it must looks something like this</p>

<pre><code>document.getElementById('sel').options.length= 0;
</code></pre>

<p>but it deletes all list, so could you help me.</p>

<hr>

<p>thanks</p>
