Let’s examine you current logic to first figure out where/when you should have your eventListeners for your button clicks.
Your current code (with the eventListener for the All button commented out) will display all users (online and offline), so it is the equivalent of when you click the “All” button. For now, you should probably start here and then figure out how to just display the online or just display the offline.
One approach you could take to display users of a specific online or offline status would be identify a user by their status. Currently, the only way to do that is look at the p element which contains the status. But if you were to use querySelectorAll to find just the p elements which contain the status “online”, it would be tricky to display all the other information like the name and the logo, because those are contained in sibling elements (h2, img). Since the 3 types of information (name, logo, and status) are nested in anchor elements (a), then why not give some special identification (like a class) to each anchor element, so you can perform a querySelectorAll to get all the links (anchor elements) with this special identification.
How? You would need to modify your outputResults function to add a class=“on” or class=“off” based on the obj.status value. I will let you figure that part out on your on.
OK, once you have figured how to make each anchor element look like one of the following:
<a class="on" href="https://www.twitch.tv/OgamingSC2" target="_blank">
<img width="50" src="https://static-cdn.jtvnw.net/jtv_user_pictures/ogamingsc2-profile_image-9021dccf9399929e-300x300.jpeg">
<p>KINGS OF THE NORTH - Winner's & Loser's Finals / FINALE</p>
<a class="off" href="https://www.twitch.tv/habathcx" target="_blank">
<img width="50" src="https://static-cdn.jtvnw.net/jtv_user_pictures/habathcx-profile_image-d75385dbe4f42a66-300x300.jpeg">
then you can add an event listener for each button. Where do you add these event listeners? How about after all of the data has been displayed on the page. You should review the querySelectorAll documentation to see how best to use it for your project. See if you can get a little more coded. If you get stuck, then reply back to this thread and someone will help you.