JSFiddle - React, Tailwind, and code Playground

HTML

<div class="panel"><b>Text</b></div>
<input type="button" name="button" id="button" value="Change Color"

CSS

.panel { 
    background-color: #00ff00; 
    color: #ffffff; 
    width: 100px; 
    height: 100px; 
    font-size: 30px;
}

JavaScript

document.getElementById('button').onclick = function() {
    if (document.styleSheets[0].cssRules)
         document.styleSheets[0].cssRules[0].style.color = "black"; 
    else if (document.styleSheets[0].rules)
        document.styleSheets[0].rules[0].style.color = "black";
}