title: Get dynamic checkbox values with jQuery
body: <p>I can't get the checked values of the dynamic check box. What am I doing wrong? <a href="http://jsfiddle.net/hxfsB/17/" rel="nofollow">http://jsfiddle.net/hxfsB/17/</a></p>
  
  <p><strong>Markup:</strong>  </p>
  
  <pre><code>&lt;html&gt;
      &lt;body&gt;
        one&lt;input type="checkbox" name='checkbox0' value="one_name" checked&gt;
       two&lt;input type="checkbox" name='checkbox1' value="one_name1"&gt;
       three&lt;input type="checkbox" name='checkbox2' value="one_name2"&gt;
           &lt;input type="button" id="envoyer" value="Envoyer Reponse"  /&gt; 
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Javascript:</strong> </p>
  
  <pre><code>$('#envoyer').click(function(e){
      var myArray=new Array(4);
      for ( var j = 0; j &lt; 3; j++){ 
          var check=$('input:checkbox[name=checkbox'+j+']').is(':checked');
          if(check==true)
              myArray[j]=$('input:checkbox[name=checkbox'+j+']').val();
      }
      alert('check '+" "+myArray[i]);
  });
  </code></pre>