JSFiddle - React, Tailwind, and code Playground
HTML
<script>
function confirmReset() {
var r = confirm('Are you sure?');
var url = window.location.pathname;
var pathArray = url.split( '/' );
var host = pathArray[1];
var newHost = '/headquarters/designReset';
if (r == true) {
window.location = host+newHost;
//document.location.href = '/headquarters/designReset';
} else {
alert('it didnt work');
}
return false;
}
</script>
<a href="#" onclick="return confirmReset();">Test</a>