Methods of deactivating a button into an unavailable state using js and jquery


Setting the disabled property to true is the disabled state. JS:


document.getElementByIdx("btn").disabled=true;

jquery


$("#btn").attr("disabled", true);

HTML:


<input type="button" value=" submit " id="btn">