enable button code example

Example 1: How disable button jquery

$( "button" ).prop( "disabled", true );

Example 2: javascript disable button

//disable the button
document.getElementById(BUTTON_ID).disabled = true;
//reable the button
document.getElementById(BUTTON_ID).removeAttribute('disabled');

Example 3: javascript how to disable a button

//Using Javascript
//Disabling a html button

document.getElementById("Button").disabled = true;
//Enabling a html button

document.getElementById("Button").disabled = false;


//Using jQuery
//Disabling a html button

$('#Button').attr('disabled','disabled');
//Enabling a html button

$('#Button').removeAttr('disabled');

Example 4: jquery enable submit button

//jQuery 1.6+ use:
$("#submitButtonID").prop('disabled', true); //disable 
$("#submitButtonID").prop('disabled', false); //enable

//jQuery 1.5 and below use:
$("#submitButtonID").attr('disabled','disabled'); //disable 
$("#submitButtonID").removeAttr('disabled'); //enable

Example 5: jquery disable button

function disable(i){
    $("#rbutton_"+i).prop("disabled",true);
}

Example 6: enable html button

$('#Button').prop('disabled', true);

Tags:

Css Example