Store contents of drop down box into var, then load the new drop down box contents using the var
<p>1.) How can I use javascript to save the contents of box1 and store it into a variable (x), separating them all by commas?
Since I will be doing some database work in the background, it is important that the values are stored using this method.</p>

<p>Example of whats in the drop down box:</p>

<pre><code>[BOX1]
volvo
saab
mercedes
audi
</code></pre>

<p>Resulting var:</p>

<pre><code>var x = volvo,saab,mercedes,audi
</code></pre>

<p>2.) Using the variable (x) how can I repopulate the drop down [BOX2] with the comma separated values.</p>

<pre><code>[BOX2]
volvo
saab
mercedes
audi
</code></pre>

<p>Here is the HTML:</p>

<pre><code>&lt;!DOCTYPE html&gt;

&lt;html&gt;

&lt;head&gt;

&lt;/head&gt;

&lt;body&gt;

&lt;select id="box1" style="width: 100px;"&gt;
  &lt;option value="volvo"&gt;Volvo&lt;/option&gt;
  &lt;option value="saab"&gt;Saab&lt;/option&gt;
  &lt;option value="mercedes"&gt;Mercedes&lt;/option&gt;
  &lt;option value="audi"&gt;Audi&lt;/option&gt;
&lt;/select&gt;
&lt;br&gt;
&lt;input type="button" value="Save" name="Save"&gt;

&lt;br&gt;&lt;br&gt;

&lt;input type="button" value="Populate" name="Populate"&gt;&lt;br&gt;

&lt;select id="box2" style="width: 100px;" name="D1"&gt;&lt;/select&gt;

&lt;br&gt;

&lt;/body&gt;

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