JSFiddle - React, Tailwind, and code Playground
HTML
<a href="someotherpage.php" >Your Link</a>
JavaScript
$(function(){
$("a").click(function(){
$(this).after("<img src='http://www.mcso.us/paid/images/ajax_load.gif' alt='loading' />").fadeIn();
return false; // comment out this to for the link to work
});
});