title: How to check "IF any one or all buttons are clicked" in jquery
body: <p>I want to enable and disable a button using jquery.</p>
  
  <p>As per my code I have few sets of "Accept" and "Reject" buttons and 1 "Authorize" button, so as per logic, when all "Accept" button are "Accepted" the "Authorize" button should be enabled and if even 1  Reject button is clicked, the Authorize button should be rejected.</p>
  
  <p>Can you please help me in how to check for "if any one or all buttons are clicked". </p>
  
  <p>here is my code below:</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt;
  &lt;div id="content-1"&gt;
      &lt;div class="rx-statusbuttons"&gt;
          &lt;input type="button" value="Accepted" class="Accepted" /&gt;
          &lt;input type="button" value="Rejected" class="Rejected redButton" /&gt;
      &lt;/div&gt;
      &lt;div class="rx-statusMessage"&gt;
          &lt;p class="rx-statusAccepted nodisplay"&gt;Accepted&lt;/p&gt;
          &lt;p class="rx-statusRejected nodisplay"&gt;Rejected&lt;/p&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;div id="content-2"&gt;
      &lt;div class="rx-statusbuttons"&gt;
          &lt;input type="button" value="Accepted" class="Accepted" /&gt;
          &lt;input type="button" value="Rejected" class="Rejected redButton" /&gt;
      &lt;/div&gt;
      &lt;div class="rx-statusMessage"&gt;
          &lt;p class="rx-statusAccepted nodisplay"&gt;Accepted&lt;/p&gt;
          &lt;p class="rx-statusRejected nodisplay"&gt;Rejected&lt;/p&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;div id="content-3"&gt;
      &lt;div class="rx-statusbuttons"&gt;
          &lt;input type="button" value="Accepted" class="Accepted" /&gt;
          &lt;input type="button" value="Rejected" class="Rejected redButton" /&gt;
      &lt;/div&gt;
      &lt;div class="rx-statusMessage"&gt;
          &lt;p class="rx-statusAccepted nodisplay"&gt;Accepted&lt;/p&gt;
          &lt;p class="rx-statusRejected nodisplay"&gt;Rejected&lt;/p&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style="clear:both"&gt;&lt;/div&gt;
  &lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  &lt;input type="submit" value="Authorize" disabled="disabled" id="authorizeButton" /&gt;
  </code></pre>
  
  <p><strong>JQUERY</strong></p>
  
  <pre><code>    $(document).ready(function () {
      $("#content-1 .Accepted").click(function () {
          $('#content-1 .rx-statusbuttons').hide();
          $('#content-1 .rx-statusRejected').hide();
          $("#content-1 .rx-statusAccepted").show();
  
      });
      $("#content-1 .Rejected").click(function () {
          $('#content-1 .rx-statusbuttons').hide();
          $('#content-1 .rx-statusRejected').show();
          $("#content-1 .rx-statusAccepted").hide();
  
      });
  
      $("#content-2 .Accepted").click(function () {
          $('#content-2 .rx-statusbuttons').hide();
          $('#content-2 .rx-statusRejected').hide();
          $("#content-2 .rx-statusAccepted").show();
      });
      $("#content-2 .Rejected").click(function () {
          $('#content-2 .rx-statusbuttons').hide();
          $('#content-2 .rx-statusRejected').show();
          $("#content-2 .rx-statusAccepted").hide();
      });
  
      $("#content-3 .Accepted").click(function () {
          $('#content-3 .rx-statusbuttons').hide();
          $('#content-3 .rx-statusRejected').hide();
          $("#content-3 .rx-statusAccepted").show();
  
      });
      $("#content-3 .Rejected").click(function () {
          $('#content-3 .rx-statusbuttons').hide();
          $('#content-3 .rx-statusRejected').show();
          $("#content-3 .rx-statusAccepted").hide();
      });
  });
  </code></pre>
  
  <p><strong>CSS</strong></p>
  
  <pre><code>.nodisplay {
      display:none;
  }
  #content-1, #content-2, #content-3 {
      float: left;
      width: 200px;
  }
  </code></pre>
  
  <p><strong>Here if the Fiddle for the same: <a href="http://jsfiddle.net/QvB37/" rel="nofollow">http://jsfiddle.net/QvB37/</a></strong></p>
  
  <p>I also tried using <strong>.length</strong> but I am not sure how to use it in my logic.</p>
  
  <p>Please suggest.</p>