title: jQuery, check if checkbox is checked with the same class
body: <p>I'm trying to get values of a table with jQuery. Every table row has a checkbox at the begining. How can I copy data of each row, but only if it's checked. All checkboxes and rows has the same class. Now I'm using this code:</p>
  
  <pre><code>var table = $("table");
      var allRows = [];
      table.find('tr').each(function (i, el) {
          if($('input:checkbox:checked').length &gt; 0){
              var $tds = $(this).find('td'),
              name = $tds.eq(2).text(),
              surname = $tds.eq(4).text();
              allRows.push(surname+";"+name+";"+"\n");
          }
      });
      allRows = allRows.join("");
  </code></pre>
  
  <p>But it's getting all the lines. How can I do this only for lines which are checked?</p>