JSFiddle - React, Tailwind, and code Playground

HTML

<span id="texto"></span>
<button id="boton">Cambiar color</button>

JavaScript

var $texto = $('#texto').html("cambio el contenido del texto");
var actual_color = 0;
colors = ['red', 'blue', 'black'];
$('#boton').click(function(){
    $texto.css('color', colors[actual_color]);
    actual_color = (actual_color + 1) % colors.length;
});