#Urgent JavaScript Help Needed - Filterable Gallery
3 messages · Page 1 of 1 (latest)
let list = document.querySelectorAll('.checkbox');
for(let i = 0; i < list.length; i++){
list[i].addEventListener('change', function(){
currFilters.push(list[i].getAttribute('data-filter'));
activeFilter();
console.log('filter');
})
}
async function activeFilter()
{
let lastPerson = data.length;
console.log(lastPerson);
for(let person = 0; person < lastPerson; person++)
{
if(currFilters.includes(data[person].author))
{
refreshGallery();
authorDisplay(person);
makeList(person);
}
}
}
This is the function I am trying to make, however even if I make it output anything to the console to check if it works, nothing happens