<pre lang="JavaScript">$(document).on("change", "#dropdown1", function () { var chklist = []; $("dropdown1:checked").each(function () { var cat = $(this).val(); chklist.push(cat); }); if (chklist.length != 0) { var Filtereditems = $.grep(Filterdata, function (element) { return chklist.indexOf(element.val1) > -1; }); if (Filtereditems.length > 0) { $.each(Filtereditems, function (i) { //bind html data }); } else { //clear result } } }); $(document).on("change", "#dropdown2", function () { var chklist = []; $("#dropdown2":checked").each(function () { var cat = $(this).val(); chklist.push(cat); }); if (chklist.length != 0) { var Filtereditems = $.grep(Filterdata, function (element) { return chklist.indexOf(element.val2) > -1; }); if (Filtereditems.length > 0) { $.each(Filtereditems, function (i) { //bind html data }); } else { // clear result } });
var chklist = [];
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)