JSFiddle - React, Tailwind, and code Playground

HTML

<p>
<a href="#">Hellod</a>
</p>

CSS

a { color: purple; background: red; padding: 4px; display: inline-block; position: relative; }
a:hover { color: orange; }

p { width: 50px; height: 50px; position: relative; border: 1px solid #333; background: #f2f2f2; padding: 15px; margin: 20px; }


p.active { background: #aaa;
-webkit-transform: rotateY(180deg);
   -moz-transform: rotateY(180deg);
    -ms-transform: rotateY(180deg);
     -o-transform: rotateY(180deg);
        transform: rotateY(180deg);
}
p.active a { z-index: 50; }

JavaScript

$('body').click(function() {
    $("p").toggleClass('active');
});