hee,
im trying toggle multiple divs based on parent checkbox value.
it doesn't seem work. rookie mistake! can me out?
html:
<li><input class="yourcheckbox" type="checkbox" value="1" /><label>type zaak</label></li> <div id="1" style="display:none;"> <label class="marginleft20" for="invtyperegeling">type zaak<strong> *</strong></label> <select multiple="multiple"> <option>bezwaar</option> <option>beroep</option> <option>administratief beroep</option> <option>proforma beroep</option> <option>proforma hoger beroep</option> <option>hoger beroep-dept. verweerder</option> <option>hoger beroep-dept. appelland </option> <option>voorlopige voorziening</option> <option>rechtstreeks beroep</option> </select> </div> javascript:
$(document).ready(function(){ $(".yourcheckbox").click(function(){ $("#"+$(this).val()).toggle(); }); ]);
a couple of things:
- your fiddle wasn't including jquery
- your sytax function ended in
]instead of} - your binding on checkbox should
.change()instead of.click()
Comments
Post a Comment