@gurkanozer
Posted
Hi, Duyen. I don't know if this help but this is how i did.
`let filterList = []
fetch(){ //get datas
//and create all cards
//visible cards has class named active so in this case i added active class to all cards.
//then select all tags in document.
const tags = document.querySelectorAll('.tag');
//and create event listener for each one.
tags.foreach(tag=>{
tag.addEventListener('click',()=>{
//add this tag to filterList.
//you need filter all cards by filterList. Then remove class active if card
//dont have this tag
});
//and re-render cards
}); `
Marked as helpful
@Duyen-codes
Posted
@gurkanozer Hey! Thanks very much for sharing your solution approach. I'll try to implement that on mine. I think my solution now is unnecessarily complicated. Thanks again and keep up the great work!