title: Comma separated list in jQuery
body: <p>I'm trying to create a comma separated list from what is checked on the form.</p>
  
  <pre><code>var $StateIDs = $(':checked');
  var StateIDs = '';
  for (i=0, j = $StateIDs.length; i &lt; j; i++) {
      StateIDs += $StateIDs[i].val();
      if (i == j) break;
      StateIDs += ',';
  }
  </code></pre>
  
  <p>There's probably a 1-liner that can do this, or a single function.</p>