How to use JaveScript to imitate the cutsom filter/selector in this example? : I saw this custom filter on this site (which is based on mediawiki): **https://fgo.wiki/w/%E8%8B%B1%E7%81%B5%E5%9B%BE%E9%89%B4** , and want to imitate its function on the fandom I've on for the self-learning purpose.

I did figure out how to get the certain innerTEXT from the table as the identifier for each option, and set a div to place all the option image. But I don't know what to do next, use addEventListener() or playing around with <select> tag?

The table's code I'm playing with is too long, so just put the codes here: https://a-normal-playground.fandom.com/wiki/Filter_searching_test?action=edit 

The "identifier" I get from the table is:
```
var type = document.querySelectorAll("tr td:nth-last-child(1)").innerTEXT;
```

What I want to do is if the identifier of that column is not matching the "value" of the button, the column will not be showed in the result. Not sure do I need the knowledge of jquery or something else. 