Basically, I have a checkbox.
If the checkbox is selected, the drop-down should appear. if unselected the drop down should not show up. Unfortunately, it's not working. This is my code below. It's not the full code but it's enough to see what's wrong.
<script>
$('[name="Lab Elective"]').on('change', function() {
$('#Lab Elective g').toggle(this.checked);
}).change();
</script>
<input type="checkbox" name="Lab Elective" id="Lab Elective" value="some value">
<select id="Lab Elective g" name="Lab Elective g">
<option value="some value">some value</option>
</select>