JSFiddle - React, Tailwind, and code Playground
HTML
<div><a href="http://www.w3schools.com">w3schools.com</a></div>
<a href="http://www.wikipedia.org">wikipedia.org</a>
<p><b>Note:</b> The :active selector styles the active link.</p>
CSS
a:active {
background-color: yellow;
}
div{
background-color: red;
}
JavaScript
$('a').mousedown(function() {
$(this).parent("div").css("background-color","yellow");
}).mouseup(function() {
$(this).parent("div").css("background-color","red");
});