Javascript clear content of selectbox
<p>As part of my populating selectbox function I am clearing the contents of the populated select box and then inserting options to a empty box. Although the select box is not being cleared correctly and a lot of options are not removed. I am using the following code to clear the contents of the select box:</p>

<pre><code>for(var i = 0; i &lt; document.getElementById(selectbox).options.length; i++)
    document.getElementById(selectbox).options[i] = null;
</code></pre>

<p>Why not all the options are removed from the selectbox?</p>
