JSFiddle - React, Tailwind, and code Playground

HTML

<span class="number">10</span>

JavaScript

function random_rgb() {
  colors = ['8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];
  r = colors.eq(Math.floor(Math.random * 8));
  g = colors.eq(Math.floor(Math.random * 8));
  b = colors.eq(Math.floor(Math.random * 8));
  return '#' + r + g + b;
};

$(document).ready({

  $("span.number").each(function(){
    this.style.color = random_rgb();
  });

});