Js and jquery set the disabled property to true to disable the button

  • 2020-03-30 03:38:54
  • 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: