I am new to jQuery and I want to enable and disable a dropdown list using a checkbox. This is my html:
<select id="dropdown" style="width:200px">
<option value="feedback" name="aft_qst">After Quest</option>
<option value="feedback" name="aft_exm">After Exam</option>
</select>
<input type="checkbox" id="chkdwn2" value="feedback" />
What jQuery code do I need to do this? Also searching for a good jQuery documentation/study material.
Here is one way that I hope is easy to understand:
http://jsfiddle.net/tft4t/
A better solution without if-else:
To enable/disable -
Demo - http://jsfiddle.net/tTX6E/
Try -
making use of
.prop
in theif
statement.JsFiddle