Jquery function passing around select options
<pre><code>$('#addAllButton').click(function () {
            var options = '';
            $('#fromList').find('option').each(function () {
                alert($(this).val());
                //options += '&lt;option value="' + $(this).val() + '"&gt;' + $(this).text() + '&lt;/option&gt;';
            });
            $('#toList').append(options);
        });

&lt;select id="fromList" name="drop1" class="listBox" multiple="multiple"&gt;
                    &lt;option value="1"&gt;item 1&lt;/option&gt;
                    &lt;option value="2"&gt;item 2&lt;/option&gt;
                    &lt;option value="3"&gt;item 3&lt;/option&gt;
                    &lt;option value="4"&gt;item 4&lt;/option&gt;
                    &lt;option value="0"&gt;All&lt;/option&gt;
&lt;/select&gt;

&lt;select id="toList" name="drop1" class="listBox" multiple="multiple"&gt;
                        &lt;option value="1"&gt;item 1&lt;/option&gt;
                        &lt;option value="2"&gt;item 2&lt;/option&gt;
                        &lt;option value="3"&gt;item 3&lt;/option&gt;
                        &lt;option value="4"&gt;item 4&lt;/option&gt;
                        &lt;option value="0"&gt;All&lt;/option&gt;
    &lt;/select&gt;
</code></pre>

<p>I have a button Add All.  I want this button to add every option from fromList select list to the toList.  My function doesn't seem to be working, can someone point me in the right direction?</p>

<p>I tried to use part of your code SpYk3HH:</p>

<pre><code>$('#addAllButton').click(function () {
                //options += '&lt;option value="' + $(this).val() + '"&gt;' + $(this).text() + '&lt;/option&gt;';
                $('#fromList').children().appendTo($("#toList"));
            });
</code></pre>

<p>I couldn't get this to work.  I have a button called Add All, so when they click it it will move everything from #fromList to #toList.  The above doesn't seem to be working either.</p>
