JSFiddle - React, Tailwind, and code Playground

by techiedelight

HTML

<!doctype html>
<html lang="en">
<body>
  <a href="https://www.bing.com/">Click Me</a>
  <br><br>
  <div>
    <button id="toggle">Toggle Hyperlink</button>
  </div>
</body>
</html>

JavaScript

$(document).ready(function() {
  var enabled = true;
  $('#toggle').click(function() {
    if (enabled) {
      $("a").fadeTo("fast", 0.5).removeAttr("href");
    } else {
      $("a").fadeIn("fast").prop("href", "https://www.bing.com/");
    }
    enabled = !enabled;
  })
});