Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Job listing with Vanilla JS, still stuck with filter functions

@Duyen-codes

Desktop design screenshot for the Job listings with filtering coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
3intermediate
View challenge

Design comparison


SolutionDesign

Solution retrospective


My filter function is not finished. I'll do more research and continue working on finishing the challenge later. I'm doing this with JS with no library or framework. I'd really appreciate if you could look at my codes and give me some lead of how to move forward with the functions. Any help/ feedback is greatly appreciated. Thanks!

Community feedback

@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

2

@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!

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord