change select tag attribute value
<p>I have one drop down menu. By default it allows only one option to select among all. I want to create a checkbox which when checked should change that dropdown menu to allow multiple options to be selected. Can someone tell me how to achieve this?</p>

<pre><code>&lt;select id="test" name="host"&gt;
    &lt;option value="host1"&gt;host1&lt;/option&gt;
    &lt;option value="host2"&gt;host2&lt;/option&gt;
    .....
    .....
&lt;/select&gt;  
</code></pre>

<p>I want this to be changed to following on checkbox being checked.</p>

<pre><code>&lt;select id="test" name="host" multiple="multiple"&gt;
    &lt;option value="host1"&gt;host1&lt;/option&gt;
    &lt;option value="host2"&gt;host2&lt;/option&gt;
    .....
    .....
&lt;/select&gt;  
</code></pre>

<p>Please help me in doing this.</p>
