Is there a way to efficiently add an event listener to multiple buttons and retrieve the value of each one based on the one that was clicked? For example:
<button id='but1'>
Button1
</button>
<button id='but2'>
Button2
</button>
<button id='but3'>
Button3
</button>
<button id='but4'>
Button4
</button>
Without having to individually reference each button in the JavaScript code like this:
Const but1 = document.getElementById('but1');
but1.addEventListener('click');