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

  • 2020-03-30 01:27:44
  • OfStack

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"> 

Related articles: