I'm trying to show values based on checkbox check and uncheck
For example, if the Show all maths check box is selected , I want to display all the package panels for which math is selected
Similarly, if the Show all physics check box is selected , I want to display all the package panels for which Physiscs is selected
I tried it like this
$(document).on('change', '.filtermaths', function() { $(".pack-panel").each(function () { var visible = $(this).find('.mathscheckbox').prop('checked') $(this).toggle(visible); }); }); $(document).on('change', '.filterphysics', function() { $(".pack-panel").each(function () { var visible = $(this).find('.physicscheckbox').prop('checked') $(this).toggle(visible); }); }); $(document).on('change', '.filterchemistry', function() { $(".pack-panel").each(function () { var visible = $(this).find('.chemistrycheckbox').prop('checked') $(this).toggle(visible); }); });
But this does not work as expected
This is my violin
http://jsfiddle.net/cod7ceho/135/
Could you tell me how to fix this?
jquery
Pawan
source share