I’ve got checkbox and text input. What I need is to disable/enable the field by checking/unchecking corresponding checkbox.
I’m interested in plain javascript approach to this.
Thanks!
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.
The very basic method to achieve this is:
Every
input[type=checkbox]element has a propertychecked, which represents the state of the checkbox. Input elements can be disabled by settingdisabledto true. Combining these two properties results in the desired behaviour.