$("#button").attr("disabled", true); //---------------------OR-------------------- jQuery("#button").attr("disabled", true); // use jQuery instead of $ to avoid conflict with other JS libraies.