title: jquery - select all checkboxes with js array name
body: <p>I want to use a JQuery "check all" function in a form like this: 
  <a href="http://jetlogs.org/jquery/jquery_select_all.html" rel="noreferrer">http://jetlogs.org/jquery/jquery_select_all.html</a></p>
  
  <p>My problem is I am generating my form from a php script, and I don't know exactly how many checkboxes I will have in advance.
  I use the "array" naming convention to be able to get all the selected checkbox values in my $_POST data...
  so my checkboxes are like that:</p>
  
  <pre><code>&lt;input type="checkbox" name="items[]" value="&lt;?php echo $id ?&gt;"&gt;
  </code></pre>
  
  <p>but this JQuery declaration does not work:</p>
  
  <pre><code>$("input[@name=items[]]").each(function()    
  {    
      this.checked = checked_status;    
  });
  </code></pre>
  
  <p>probably because the "[]" at the end of my "items" messes up the JQuery declaration... I tried to write @name=items[] like that: "@name=items[]", and to put some anti-slash before the [ and ] so they're not considered as special characters but it didnt work...</p>
  
  <p>If someone knows a solution and is willing to share it'd be great!! :)</p>