JSFiddle - React, Tailwind, and code Playground
HTML
<a id="text">Link</a>
CSS
a{cursor:pointer;user-select:none}
JavaScript
text.onmouseenter=function(){mouseEnter()}
text.onmouseleave=function(){mouseLeave()}
function mouseEnter(){text.style.backgroundColor="#000";text.style.color="#fff"}
function mouseLeave(){text.style.backgroundColor="#fff";text.style.color="#000"}