for <button>
tags
$("button").attr("disabled", true);
for <input type="button">
tags
$("input[type=button]").attr("disabled", true);
FOR JQuery 1.6+ change attr
to prop
or simply write the disabling line in plain javascript
$("button, input[type=button]").each(function () {
this.disabled=true;
});
UPDATE:
if you want to disable buttons which are created dynamically, make sure you run the code after the buttons are created, and not before/on page load.
if you are using Ajax, you will need to disable the buttons on the ajax success function, after you update the table with the buttons.
Below is an example of what you need to do:
var options = {
type: "POST",
//...
//more ajax vars
//...
success: function (response) {
//...
//update your table with the buttons,
//...
//disable buttons using one of the methods from above:
$("button, input[type=button]").each(function () {
this.disabled=true;
});
}
};
$.ajax(options);