I have created an form in which I have made the input field disabled by default->
<input class="name" type="text" maxlength="50" value="Hritika Agarwal" disabled="" />
I want to make this editable on button click. So created a button like this ->
<button class="accept-btn" onclick="myFunction()">Edit</button>
function myFunction() {
document.getElementById("name").removeAttribute("disabled");
}
But It's not working.
I have even tried like this also->
function myFunction() {
document.getElementById("name").style.disabled = "false";
}
But again nothing happened. How could I resolve this>