- $(function() {
- $('#val_0').change(function() {
- var show=$('#val_0').not(':checked').length && $("input[name='val_1']:checked").val() == 'custom';
- $(".custom-row").toggle(show);
- }).change();
- });
Should do the same things.
.change() runs the change handler one extra time in the beginning.
.toggle() does a show or hide depending on the parameter