JSFiddle - React, Tailwind, and code Playground

HTML

<div>
<p id ="color" onclick="changeFunction()">This text can change colors</p>
<button id="changeColor" onclick="changeFunction()"> Click Me</button>
</div>
<script>
function changeFunction(){
var words = document.getElementById('color');
words.style.color = 'red';
}
</script>