How to synchronize two filters?

Hello! I can not synchronize the two filters. If, for example, the first filter, choose the second checkbox, and the second 3, the selected first filter blocks are hiding. How to do the blocks just added? How to write the selector?
https://jsfiddle.net/drtvader/63zqhu1f/6/
July 12th 19 at 17:28
1 answer
July 12th 19 at 17:30
That's just to split swears, why can this be?
$( document ).ready(function() {
 $("input[type='checkbox']").click(function() {
 if (!$("input[type='checkbox']").is(":checked")){
$('.time-message__event-info').show();
 } else {
$('.time-message__event-info').hide();
 $("input[type='checkbox']").each(function() {
 if($(this).is(':checked')) {
 var filter = $(this).attr('filter');
 var data = $(this).attr('data');
 $.each($('.time-message__event-info'), function() {
 var p = $(this);
 var fs = $(this).attr(filter).split(",");
 $.each(fs, function(index, value) {
 if(data == value) {
p.show();
}
});
});
}
});
}
});
});

Find more questions by tags JavaScriptjQuery