I’m busy building a product listing page and I am trying to figure out how I can hide certain products when a checkbox is clicked. I did a bit of reading and I think I could do this using JavaScript. If anyone is able to take a look at the page in question it would be much appreciated if someone could suggest how this should be coded.
I’m not sure if I can link to my private website within the forum?
This is starting to make sense to me. If I set all products as listed on the initial page with the class of hide and toggle them to display on with another class pertaining to their category which I can toggle to show by their Elemend.classList?
What I essentially want to achieve is a page of products e.g.
Product 1, Product 2, Product 3
Product 1 and 2 have the same class of ‘Bollard’ and Product 3 has a class of ‘Component’. I want to build a checkbox selector that when checkbox ‘Component’ is pressed only products which are components should display. Initially when the user lands on the page I want all of the products to show and only that of the checkbox when that is pressed and or multiple check-boxes selected too. Does that make sense?