How can I remove the “disabled” attribute from an HTML input using javascript?
<input id="edit" disabled>
at onClick I want my input tag to not consist of “disabled” attribute.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Set the element’s
disabledproperty to false:If you’re using jQuery, the equivalent would be:
For several input fields, you may access them by class instead:
Where
documentcould be replaced with a form, for instance, to find only the elements inside that form. You could also usegetElementsByTagName('input')to get all input elements. In yourforiteration, you’d then have to check thatinputs[i].type == 'text'.