title: How set checked checkbox if it's value is in array
body: <p>I have inputs:</p>
  
  <pre><code>  &lt;div id="my"&gt;
     &lt;input type="checkbox" value="1" name="names[]"&gt;
     &lt;input type="checkbox" value="2" name="names[]"&gt;
     &lt;input type="checkbox" value="3" name="names[]"&gt;
     &lt;input type="checkbox" value="4" name="names[]"&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>And my javascript:</p>
  
  <pre><code>initValues=[1,2,3];
  $('#my').find(':checkbox[name="names[]"]').each(function () {
    $(this).prop("checked", ($.inArray($(this).val(), initValues)));
  });
  </code></pre>
  
  <p>And now all my checkboxes are checked. How must I change  my code to set checked  for ckeckboxes which values are in initValues array? </p>