mardi 27 septembre 2016

How to automatically uncheck label for array of divs, Javascript?

so my checkbox appears checked and I want it unchecked to start with (so the user can check it and images appear). Right now it's working in reverse. Is there a way to fix this? Thanks in advance!

Below is a working example and below that, the Javascript.

http://ift.tt/2czoo5L

function filterItems() { var colors = $(":checkbox:checked").map( function(){ return this.value; }).get(); var goodClasses = colors.join(","); $(".item").show().filter(goodClasses).hide(); }

filterItems();

$(":checkbox").change(filterItems);

});




Aucun commentaire:

Enregistrer un commentaire