How to set one select box equal to another?
<p>I have two identical select boxes (aside from their names, of course), and I need to have the value of the second select box be set equal to the value of the first when a checkbox is checked. Here's part of my code:</p>

<pre><code>&lt;form id="theForm" name="theForm"&gt;

&lt;select name="stateSelect" id="stateSelect"&gt;
        &lt;option value="AL"&gt;Alabama&lt;/option&gt;
        &lt;option value="AZ"&gt;Arizona&lt;/option&gt;
        &lt;option value="AR"&gt;Arkansas&lt;/option&gt;
&lt;/select&gt;

&lt;select name="stateSelect2" id="stateSelect2"&gt;
        &lt;option value="AL"&gt;Alabama&lt;/option&gt;
        &lt;option value="AZ"&gt;Arizona&lt;/option&gt;
        &lt;option value="AR"&gt;Arkansas&lt;/option&gt;
&lt;/select&gt;

&lt;input type="checkbox" name="checky" onClick="doStuff()"&gt;
&lt;/form&gt;

doStuff() 
{
    // change it from here
}
</code></pre>

<p>So, I've tried a bunch of different things, including code I've found on forums and on SO, but nothing seems to work. What code should I have in my javascript function so that when the function runs the second select box is set equal to the first?</p>

<p>Thanks for your help!</p>
