title: Disable button if checkbox is checked and label is a specific text
body: <p>I have a table with a datagrid (checkboxes and labels in each row). I want to disable a button by checking if a label is &quot;Forbidden&quot;. The user can check multiple checkboxes. So my question is how do I get all the checked checkboxes and then check if the label in each selected row is of value &quot;Forbidden&quot; so I can disable the button.</p>
  <p>I tried something like this:</p>
  <pre><code>$(function() {
      checkboxes = document.querySelectorAll('[id=checkId]');
      var validateBtn = $('button[name=&quot;btnVal&quot;]');
      checkboxes.forEach((cb) =&gt; {
          cb.addEventListener('change', checkStatus);
      });
      function checkStatus() {
          //to-do
          // if ($(this).is(&quot;:checked&quot;)) {
              
              var label = document.getElementById('statusLabel');
              if (label.textContent == &quot;Forbidden&quot;) {
                  validateBtn.prop('disabled', true);
              }
          }
      });
  </code></pre>
  <p>The table looks like this:<a href="https://i.stack.imgur.com/WZhHW.png" rel="nofollow noreferrer">enter image description here</a> In this case the button should be disabled as we have selected a forbidden status.</p>