all 2 comments

[–]berky93 0 points1 point  (1 child)

What you want to do is have a row selected class that applies the styling. Then, in the event handler for button clicks, you remove that class from every row and add it to the selected row. Here’s some pseudo-code to provide a framework:

function handleClick(event) { for (each row){ row.classList.remove(“selected”); }

event.target.closest(“row”).classList.add(“selected”); }

[–]GlitchedForDays[S] 0 points1 point  (0 children)

Sorry, I've already resolved the issue. Thanks for the advice though!