Categorization Projects with HTML, CSS & JS

I have a webpage with lists of DIV that shows my projects. Each project has a tag that describes its type, such as Graphic Design, Animation, or Photography. I want to add buttons as well for viewers to filter through tags. If a viewer clicks on the Photography button, all other projects should be hidden.

Is it possible to make a function like this in JS? How do I target projects (divs) with their tag?