I am trying to create a number of input checkboxes that are available only when others are first checked.
My problem: It's working for the first checkbox, when checked, it's displaying the second box but it won't do the same for the third when "#2" is selected.
this is the jQuery code:
jQuery('#1').change(function(){
if(jQuery(this).prop("checked")) {
jQuery('#2').show();
} else {
jQuery('#2').hide();
}
});
jQuery('#robot').change(function(){
if(jQuery(this).prop("checked")) {
jQuery('#robot2').show();
} else {
jQuery('#robot2').hide();
}
});
made a fiddle for the entire thing here: https://jsfiddle.net/srjjj/0Lpd6wzt/1/