JSFiddle - React, Tailwind, and code Playground

HTML

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

JavaScript

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