title: javascript: select all options with are in array
body: <p>I've go a multiselect:</p>
  <pre><code>&lt;select id=&quot;select1&quot; multiple&gt;
    &lt;option value=&quot;1&quot;&gt;1&lt;/option&gt;
    &lt;option value=&quot;2&quot;&gt;2&lt;/option&gt;
    &lt;option value=&quot;3&quot;&gt;3&lt;/option&gt;
    &lt;option value=&quot;4&quot;&gt;4&lt;/option&gt;
    &lt;option value=&quot;5&quot;&gt;5&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  <p>and javascript object:</p>
  <pre><code>{
   0: {id: 1, name: test1}
   1: {id: 3, name: test3}
   2: {id: 5, name: test5}
  }
  </code></pre>
  <p>How to make options &quot;selected&quot; and change value of select using ids  from javascript array?</p>
  <p>Maybe there is some simple JS function for that?
  I coded that: but this was a big bunch of code...maybe somebody knows how to do it simple way?</p>