I am working in a project where I have to create diferent checkboxes and filters out of data stored in a table. I have to add a checkbox for "republican members", "independents" or "democrats". So when the checkbox of "democrats" is checked, it just shows the data of that group of memebers, ad the same for "independents" and "republicans". So far, I have a function for each group, as shown:
var partyD = document.getElementById("democrat");
var showMembersD = [];
partyD.addEventListener("click", function(e) {
if (e.partyD.checked) {
function checkMembers() {
for (var i = 0; i < members.length; i++) {
var party = members[i].party;
if (party === "R" && party === "I") {
display = "none";
} else {
showMembersD.push(members[i]);
}
}
}
}
checkMembers();
});
Aucun commentaire:
Enregistrer un commentaire