JSFiddle - React, Tailwind, and code Playground

by wpatter6

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<a href="https://www.google.com">Click me!</a>

JavaScript

$("a").click(function (e){
	//stop the link from navigating
	e.preventDefault();
  
  //do something
  
  //once something is done, navigate browser
  window.location = $(this).attr("href");
})