JavaScript change class with select form
<p>I need a select form that will change the class of a div element. From the sample code below, how can I use JavaScript to change the class of div(myBox) depending on the selection. </p>

<pre><code>    &lt;html&gt; 
    &lt;head&gt; 
    &lt;style type="text/css"&gt; 
    .red {background:#FF0000;color:#FFF} 
    .white {background:#FFF;color:#000} 
    .blue {background:#0000FF;color:#FFF} 
    &lt;/style&gt; 
    &lt;/head&gt; 

    &lt;body&gt; 
    &lt;form id="myform" action="#"&gt; 
    &lt;select id="bgcolor"&gt; 
        &lt;option value="red"&gt;Red&lt;/option&gt; 
        &lt;option value="white"&gt;White&lt;/option&gt; 
        &lt;option value="blue"&gt;Blue&lt;/option&gt; 
    &lt;/select&gt; 
    &lt;/form&gt; 

    &lt;div id="myBox" class="red"&gt;This is myBox&lt;/div&gt; 

    &lt;/body&gt; 
    &lt;/html&gt; 
</code></pre>
