title: How to append values to hidden field?
body: <p>I have a one field which is hidden and that gets added dynamically to track the another select box's selected items. </p>
  
  <p>for e.g:</p>
  
  <pre><code>    hidden_field_name= count_select;
  
      select_box_name = select1;
  </code></pre>
  
  <p>both gets added dynamically when user click "add" button. Now I want to store the select1's selected item count in count_select for every instance. </p>
  
  <p>But when I use the val() method it write the total click's in count_select value. </p>
  
  <p>Here is code:</p>
  
  <p>Html code : </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function getCount() {
    top.count = $("select.container_countable option:selected[value!='']").length;
    $('.countable').val(top.count);
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;input type='hidden' class='countable' id='count_containerfilter' name='countable_cont' value=0&gt;
  &lt;select onclick='getCount()' class='container_countable' multiple='multiple' name='new_containerfilter'&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Any idea why is this happening?</p>