title: Disable all buttons on page
body: <p>I have an MVC view with a number of buttons on it (each item in a basket renders 2 buttons)...</p>
  
  <pre><code>&lt;button class="pbbg" id="ProductMinus_161637" type="button"&gt;-&lt;/button&gt;
  &lt;button class="pbbg" id="ProductPlus_161637" type="button"&gt;+&lt;/button&gt;
  </code></pre>
  
  <p>(they both have an <code>onclick</code> event)</p>
  
  <p>When either of these buttons are pressed I want to disable all the buttons for every product until the basket has finished updating.</p>
  
  <p>The click event calls a JavaScript function which in turn makes an Ajax call.  Following this <a href="https://stackoverflow.com/questions/3822054/how-to-disable-all-buttons-on-the-page-while-uploading">post</a> the first thing I try to do is disable all the buttons.....  </p>
  
  <pre><code>$("input[type=button]").attr("disabled", "disabled");
  </code></pre>
  
  <p>Then after the Ajax call returns reenable them....</p>
  
  <pre><code>$("input[type=button]").removeAttr("disabled");
  </code></pre>
  
  <p>I am getting no errors but the buttons are not disabled.</p>
  
  <p>Where I am going wrong?</p>