JSFiddle - React, Tailwind, and code Playground
HTML
<a id="specialLink" href="redirectToApp()" target="_blank">click me</a>
<script>
document.getElementById('specialLink').href = redirectToApp();
function redirectToApp () {
return "https://www.w3schools.com/";
}
</script>