title: Html select multiple get all values at onchange event
body: <p>I have a form with a select multiple. I want to get all selected values at onchange event but i dont know if this is possible. I think "this.value" only returns the last element selected.</p>
  
  <p>Is it possible to get all the elements selected as array at onchange??</p>
  
  <p>Thanks in advance. </p>
  
  <pre><code>&lt;select name="myarray[]" id="myarray" class="select2-select req" style="width: 90%;" onChange="get_values(this.value)" multiple&gt;
      {foreach key=key item=value from=$myarray}
           &lt;option value="{$key}" &gt;{$value}&lt;/option&gt;
      {/foreach}
  &lt;/select&gt;
  </code></pre>