JSFiddle - React, Tailwind, and code Playground
HTML
<a href="#" class="random-color">Test link 1</a>
<a href="#" class="random-color">Test link 2</a>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
// Colors array with whatever colors you want
var colors = ['#ff8800','#ff00ff','#00ffcc'];
// This applies a random color to the link when you hover it
$('.random-color').mouseenter(function(){
$(this).css('color', colors[ Math.floor( Math.random() * colors.length ) ]);
})
// This function will return the color of the link to default when the mouse leaves
$('.random-color').mouseleave(function(){
$(this).css('color', '#0000ee');
})
</script>