JSFiddle - React, Tailwind, and code Playground
HTML
<p id="myP">This is an example paragraph.</p>
<button type="button" onclick="myFunction()">Return text color of p</button>
<script>
function myFunction() {
var element = document.getElementById('myP'),
style = window.getComputedStyle(element),
color = style.getPropertyValue('color');
alert(color);
}
</script>
CSS
#myP {
color: pink;
}