Update selected values in Multi select with Jquery?
<p>This is my function to check which checkboxs are checked.</p>

<pre><code>function updateTagChecked() {
         var list_tag_selected = [];//to store the value of checkboxs selected.
     $('input[name=tag]:checked').each(function() {
         list_tag_selected.push($(this).val());
        });
     $('#tag_checked').val(list_tag_selected.join("&amp;"))//Append this list to hidden field

    }
    //When are checkbox are click?
    $(function() {
         $('#collapse_option input').click(updateTagChecked);
         updateTagChecked();
     });
</code></pre>

<p>I want to do the same thing for multi select</p>

<pre><code>&lt;div id collapse_option&gt;
    &lt;li&gt;&lt;label for="id_city"&gt;City:&lt;/label&gt; 
   &lt;select multiple="multiple" name="city" id="id_city"&gt;
    &lt;option value="1"&gt;Phnom Penh&lt;/option&gt;
    &lt;option value="2"&gt;Takeo&lt;/option&gt;
    &lt;option value="3"&gt;Kampot&lt;/option&gt;
    &lt;option value="4"&gt;Kampongthom&lt;/option&gt;
    &lt;option value="5"&gt;Siemreip&lt;/option&gt;
    &lt;option value="6"&gt;pursat&lt;/option&gt;
    &lt;option value="7"&gt;preyveng&lt;/option&gt;
    &lt;/select&gt;&lt;/li&gt;
  &lt;/div&gt;
&lt;input type="hidden" id="store_multiselected" name="store_multiselected" value=""/&gt;
</code></pre>

<p>In multi select Can we do this.?I want to store value for every selected in multi select in hidden field as I mention above.</p>
