title: Enable/Disable checkbox based on value of dropdown
body: <p>I have an HTML table that includes a dropdown with 3 selections, Yes, No, Exempt and also a checkbox. I have set the value of Yes = 1, No = 0, and Exempt = 2. On page load, if the dropdown value equals 0 or 2, then the checkbox should be disabled. If the dropdown value equals 1, then the checkbox should be enabled. However, currently I have had no luck with getting the correct result. I was able to get the value of the first row before, but that did not traverse through the entire table.</p>
  
  <p>How can I traverse through the entire table to find each value of the dropdown, and also enable/disable the checkbox based on what is in the dropdown?</p>
  
  <p>Javascript:</p>
  
  <pre><code>$(document).ready(function () {
      $('#billing_table tr').each(function() {
  
      var checked = $(this).find($(".billed-select")).val();
      console.log(checked);
  
      if(checked != "1") {
          $('.paid').attr('disabled', true);
      } else {
          $('.paid').attr('disabled', false);
      }
    });
  });
  </code></pre>
  
  <p>HTML Table:</p>
  
  <pre><code>&lt;table id="billing_table"&gt;
  &lt;thead&gt;
      &lt;tr&gt;
      &lt;td style="display: none"&gt;Account&lt;/td&gt;
      &lt;td&gt;Collector Name&lt;/td&gt;
      &lt;td&gt;Customer&lt;/td&gt;
      &lt;td&gt;Bill Date&lt;/td&gt;
      &lt;td&gt;Days Until&lt;br&gt;Next Action&lt;/td&gt;
      &lt;td&gt;Next Action&lt;/td&gt;
      &lt;td&gt;Billed&lt;/td&gt;
      &lt;td&gt;Bill&lt;br&gt;Amount&lt;/td&gt;
      &lt;td&gt;Payment&lt;br&gt;Due Date&lt;/td&gt;
      &lt;td&gt;Notes&lt;/td&gt;
      &lt;td&gt;Paid&lt;/td&gt;
      &lt;td&gt;Save&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
  
  
  &lt;?php
      foreach ($dbh-&gt;query($bill) as $rows) {
      ?&gt;
      &lt;tr class="row"&gt;
          &lt;td&gt;&lt;/td&gt;
          &lt;td&gt;&lt;/td&gt;
          &lt;td&gt;&lt;/td&gt;
          &lt;td&gt;&lt;/td&gt;
          &lt;td&gt;&lt;/td&gt;
          &lt;td&gt;&lt;/td&gt;   
  
          &lt;?php if ($rows ['Billed Status'] == 'Billed') {?&gt;      
          &lt;td&gt;
              &lt;select class="billed-select"&gt;
                  &lt;option class="selection" value="1" selected&gt;Yes&lt;/option&gt;
                  &lt;option class="selection" value="0"&gt;No&lt;/option&gt;
                  &lt;option class="selection" value="2"&gt;Exempt&lt;/option&gt;
              &lt;/select&gt;
          &lt;/td&gt;    
          &lt;?php } else if ($rows ['Billed Status'] == 'Unbilled'){ ?&gt;       
          &lt;td&gt;
              &lt;select class="billed-select"&gt;
                  &lt;option class="selection" value="1"&gt;Yes&lt;/option&gt;
                  &lt;option class="selection" value="0" selected&gt;No&lt;/option&gt;
                  &lt;option class="selection" value="2"&gt;Exempt&lt;/option&gt;
              &lt;/select&gt;
          &lt;/td&gt;
          &lt;?php } else if ($rows ['Billed Status'] == 'Exempt'){ ?&gt;       
          &lt;td&gt;
              &lt;select class="billed-select"&gt;
                  &lt;option class="selection" value="1"&gt;Yes&lt;/option&gt;
                  &lt;option class="selection" value="0"&gt;No&lt;/option&gt;
                  &lt;option class="selection" value="2" selected&gt;Exempt&lt;/option&gt;
              &lt;/select&gt;
          &lt;/td&gt;
          &lt;?php } ?&gt;
  
          &lt;td&gt;&lt;/td&gt;
          &lt;td&gt;&lt;/td&gt;
          &lt;td&gt;&lt;/td&gt;
  
          &lt;?php if ($rows ['Payment Status'] == 'Paid') {?&gt;
          &lt;td align="center"&gt;&lt;input type="checkbox" id="paid" class="paid" name="paid" checked&gt;&lt;/td&gt;
          &lt;?php } else { ?&gt;
          &lt;td align="center"&gt;&lt;input type="checkbox" id="paid" class="paid" name="paid"&gt;&lt;/td&gt;
          &lt;?php } ?&gt;
  
          &lt;td&gt;&lt;/td&gt;
      &lt;/tr&gt;
   &lt;?php
    }
   ?&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>