JSFiddle - React, Tailwind, and code Playground
HTML
<span class="randomRoll">changing text?</span> other text
JavaScript
$(function() {
$(".randomRoll")
.mouseover(function() {
var colors = ["6F216C", "F34B0D", "C50102", "5DA537", "F1D81B"];
var pick = Math.floor(Math.random()*5);
var colorN = colors[pick];
$(this).css('color',colorN);
//alert(colorN);
})
.mouseout(function() {
$(this).css('color','black');
});
});