Categories
JavaScript Answers

How to remove disabled attribute from HTML input with JavaScript?

Spread the love

Sometimes, we want to remove disabled attribute from HTML input with JavaScript.

In this article, we’ll look at how to remove disabled attribute from HTML input with JavaScript.

How to remove disabled attribute from HTML input with JavaScript?

To remove disabled attribute from HTML input with JavaScript, we set the disabled property to false.

For instance, we write

document.getElementById("my-input-id").disabled = false;

to select the input with getElementById.

Then we set its disabled property to false to remove the disabled attribute from the input.

Conclusion

To remove disabled attribute from HTML input with JavaScript, we set the disabled property to false.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published.