I am trying to pass different link on a same variable using different buttons with html and js

For my new project, I am trying to pass a link in a variable. I have buttons (multiple buttons let’s say 50 buttons). So what it has to do is on button 1 click it should pass to var link = button1link.html and on button 2 click it should pass a variable to var link = button2link.html. making a specific function to each button is quite a long process so, In short, a specific button click should pass a specific link to var link . please help me out with it.
Thanks 😀

 <button id="button1"  onclick= "seturl();">click here </button>
var link = "linkOfButton1.html"