Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 1st, 2012  |  syntax: None  |  size: 0.76 KB  |  hits: 5  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. jQuery disable all button of a css class and input type button
  2. <input class="submit2" type="button" name="submit2"  value="Submit" id="submit1" onclick="">
  3.        
  4. $(document).ready(function() {
  5.  
  6.     $('.submit2').click(function() {
  7.  
  8.         $("input.submit2").attr('disabled', true);
  9.  
  10.     });
  11. });​
  12.        
  13. $(document).ready(function(){
  14.     $('.submit2').click(function() {
  15.         $(this).attr('disabled', true);
  16.     });
  17. });
  18.        
  19. $("input.submit2").attr('disabled',"disabled");
  20.        
  21. $("input.submit2").prop('disabled',true); // here jQuery will normalize the value and set the property
  22.        
  23. $(document).ready(function(){
  24.      var $submitButton = $(this, "input[type='submit']");
  25.      $submitButton.attr("disabled", "true");
  26.        
  27. $("input.submit2").attr('disabled','disabled');