I want to change the region in an api url depending on a button the is active.
(Example API: (region).apiurl.net)
If a person selects the button EUW, region would change to EUW, if a person selects Finland, region would change to finland.
Simply use variables, like this:
<button onclick="region='EUW'">Western Europe</button> <button onclick="region='Finland'">Finland</button>
Finally call the API from JavaSript using your variable:
var apiUrl = region + ".apiurl.net";
I hope you find this useful