I want to use javascript to set the attribute disabled=”disabled” to the with id age 2 when the checkbox with id “exactage” is enabled. Any ideas? Thanks in advance. A happy coder 🙂
<select id="age">
<option value="18"><18</option>
</select>
<select id="age2">
<option value="18"><18</option>
</select>
<input type="checkbox" id="exactage"/> Require exact age
If by enabled you mean checked
If by enabled you actually mean enabled, you can do this: