JSFiddle - React, Tailwind, and code Playground
HTML
<p id="text">some text</p>
<button type="button" onclick="colorChange()">red</button>
JavaScript
function colorChange() {
document.getElementById('text').style.color = "red";
}
<p id="text">some text</p>
<button type="button" onclick="colorChange()">red</button>
function colorChange() {
document.getElementById('text').style.color = "red";
}