JSFiddle - React, Tailwind, and code Playground

HTML

<a href="https://www.example.com" onclick="myFunction()" target="_blank" rel="nofollow">example.com</a>

JavaScript

function myFunction() {
  var confirmresult = confirm("Press a button!");
  if (confirmresult == true) {
    // OK = go away!
  } else {
  	// Cancel = stay here!
	event.preventDefault();
  }
};