Free programming examples and instructions

Remove disabled attribute from html control

Code, example and demo for how to remove disabled attribute from html control

by Athil

Posted on 04 May 2017 Category: Javascript Views: 1390

Edited on 25 Jul 2018


Hi, here I am going to show to enable HTML control through javascript. By using 

Method 1

document.getElementById('ControlId').disabled = false;

Method 2 


Full Example


Demo for remove disabled attribute from Html Control
<p>Click the button to remove disabled attribute of textbox</p>
<h3>Method 1</h3>
<input type="text" id="txtname" disabled="true">

<button id="tbnRemove" onclick= "removeDisbled();" >Remove disabled </button>
<h3>Method 2</h3>
<input type="text" id="txtname2" disabled="true">

<button id="tbnRemove" onclick= "removeDisbled2();" >Remove disabled </button>

function removeDisbled()
    document.getElementById('txtname').disabled = false;
function removeDisbled2()


Leave a Comment: