JSFiddle - React, Tailwind, and code Playground
HTML
<button class="open" data-url="https://www.google.com">
Google
</button>
<button class="open" data-url="https://www.youtube.com">
YouTube
</button>
JavaScript
document.addEventListener("click", function(event){
if (event.target.className == "open"){
window.open(event.target.dataset.url);
}
});