JSFiddle - React, Tailwind, and code Playground
by Joshua Dwire
HTML
Note that I'm using <code>window.location.href</code> instead of <code>window.top.location.href</code>, because JSFiddle doesn't allow navigating the top frame.<br>
<input type="button" class="button" id="myButton" onClick="go()" value="click here">
JavaScript
function go() {
var url = getUrl();
window.location.href= url;
}
function getUrl(){
return "https://example.com";
}