JSFiddle - React, Tailwind, and code Playground
HTML
<a id="test">test anchor tag</a>
CSS
a {color: red;}
a:hover {color: blue;}
JavaScript
function getCssPropertyForRule(rule, prop) {
var sheets = document.styleSheets;
var slen = sheets.length;
for(var i=0; i<slen; i++) {
var rules = document.styleSheets[i].cssRules;
var rlen = rules.length;
for(var j=0; j<rlen; j++) {
if(rules[j].selectorText == rule) {
return rules[j].style[prop];
}
}
}
}
alert("Hovered Colour is "+getCssPropertyForRule('a:hover', 'color'));