title: Iterate through all columns of a jquery datatable and get data from a row which has a specific class
body: <p>I am trying to get data from a jquery datatable from a row which are having a specific class.</p>
  
  <p>My table looks like below: The datatable also has pagination.</p>
  
  <pre><code>ID  |  DocumentID |  FileName |          |
  ------------------------------------------
  1   |          201| abc.cc    | check box|
  </code></pre>
  
  <p>I have added a class to some rows by using the below code:</p>
  
  <pre><code>$('body').on('change', 'input.checked-box', function () {
  
      if ($(this).prop('checked') == true) {
  
          $(this).closest('tr').addClass('selectedRow');
      }
      else {
          $(this).closest('tr').removeClass('selectedRow');
      }
  
      if (table.rows('.selectedRow').data().length &gt; 0) {
  
          $('#downloadDoc').removeClass('inactive');
          $('#downloadDoc').addClass('active');
      }
      else {
          $('#downloadDoc').removeClass('active');
          $('#downloadDoc').addClass('inactive');
      }
  });
  </code></pre>
  
  <p>In the above code: <code>input.checked-box</code> is a checkbox <code>&lt;input type='checkbox' class='checked-box' id='check0'&gt;</code>, the checkbox are added to each row with a specific ID. When a checkbox is clicked the corresponding row gets the <code>class='selectedRow'</code>. So, the above code is adding a class to each row when the corresponding checkbox is checked. So far working good.</p>
  
  <p>Now, how I can get data of "DocumentID" column (as shown in the above table) for rows which has the <code>class='selectedRow'</code> when I click a button (say for <code>&lt;button id='downloadDoc' class='active'&gt;</code>) </p>
  
  <p>My HTML:</p>
  
  <pre><code>&lt;div class="table-responsive"&gt;
    &lt;button id='downloadDoc' class='inactive'&gt;
  
    &lt;table id="attachmentList" class="display"&gt;
       &lt;thead&gt;
          &lt;tr&gt;
             &lt;th&gt;&lt;/th&gt;
             &lt;th&gt;Attachment Detail Id&lt;/th&gt;
             &lt;th&gt;File Name&lt;/th&gt;
             &lt;th&gt;&lt;/th&gt;
           &lt;/tr&gt;
       &lt;/thead&gt;
       &lt;tbody&gt;&lt;/tbody&gt;
     &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>