Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

changing disabled property of a button

I have an html button, and I have dynamically disabled it using the following property values

disabled="disabled"

How can i make it work again? i dont want to make it disabled now

like image 448
akshay Avatar asked Nov 27 '22 22:11

akshay


2 Answers

You can just set the disabled property to false in JavaScript, like this:

document.getElementById("myId").disabled = false;
like image 171
Nick Craver Avatar answered Nov 30 '22 23:11

Nick Craver


var e = document.getElementById("someElement");
e.removeAttribute("disabled");

and disable again,

e.setAttribute('disabled','disabled');
like image 43
miqbal Avatar answered Dec 01 '22 00:12

miqbal