代码片段

 $.each($('#items').children(), function(index, value) {
        if ($(this).attr("label-cate") == id) {
            $(this).show();
        } else {
            $(this).hide();
        }
    });

原文地址:https://www.cnblogs.com/Alan2016/p/5120538.html