mardi 4 avril 2017

jquery filter on multiple array

HTML

<ul>
    <li data-filters={["red","green","blue"]}>x</li>
    <li data-filters={["red","green","yellow"]}>x</li>
    <li data-filters={["white","green","gray"]}>x</li>
</ul>

JQUERY

var searchIDs = []; // array used to filter
        $( ".filter_check input:checkbox:checked" ).map(function(){
            searchIDs.push($(this).val());
        });

I should hide evry < li > that doesn't have values checked with checkbox. How to do it in jquery?




Aucun commentaire:

Enregistrer un commentaire