How do I add an event listener to multiple buttons and get the value of each one depending on the one clicked. Eg:
In this case, you could use a class instead of id to grab every button.
And then in JS:
const buttons = document.querySelectorAll('.btn')
buttons.forEach(function(currentBtn){
currentBtn.addEventListener('click', handleEvent)
})
You just loop over the buttons constant which hold a NodeList with all the buttons that were found. read about document.querySelectorAll