how do i loop over buttons that have the same class but are to do different things?

in a case like the image, how do i assign the different calculation algos to each button but with much lesser code, rather than writing out different codes for each button?
const tipButtons = document.querySelectorAll('.select_btn');
tipButtons.forEach(elem => {
console.log("button clicked");
});
const tipButtons = document.querySelectorAll('.select_btn');
tipButtons.forEach(elem => {
console.log("button clicked");
});
nothing logs to the console.
2 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
winniffy
winniffyOP3y ago
thank you.
Want results from more Discord servers?
Add your server