JSFiddle - React, Tailwind, and code Playground

HTML

<p id="foo">Some text</p>

JavaScript

function flash() {
    var text = document.getElementById('foo');
    text.style.color = (text.style.color=='red') ? 'green':'red';
}
var clr = setInterval(flash, 1000);