Trouble with changing my HTML onclicks into JS event listeners

Hi there.

I’m working on my twitch project and have been triggering all my buttons etc with the HTML onclick. I read that a lot of people don’t like mixing Javascript with HTML, so I’m trying to use addEventListener instead.

My problem is that previously I would have something like onclick = “fcc(this)”, but when I set up an event listener I don’t know how to pass the this argument through. I think I might have to use bind(), but I’m not really familiar with it and can’t get it working.

Here is my codepen.

An example of this in the tab div, which needs to pass through what tab is being pressed. Any advice would be appreciated.

This worked perfectly! Thanks for taking the time to show this, much appreciated!