JSFiddle - React, Tailwind, and code Playground

HTML

<ul>
<li id="a">
    
    <p>In Chrome this text will turn red and stay red. Why?</p>
    <span id="s">Text</span>
    
</li>
</ul>

JavaScript

var t = true;

setInterval(function(){
    t = !t;
    if(t){
        $('#s').css({color: 'rgb(255, 0, 0)'});
    } else {
        $('#s').removeAttr('style');    
    }
}, 1000);