JSFiddle - React, Tailwind, and code Playground

by IllusionMH

HTML

<a href="#1">111</a>  <a href="#2">222</a> <br />
<button id="chk">check</button>
<p id="res">Click check</p>

JavaScript

document.getElementById("chk").onclick = function() {
    var lnk = document.links;
     document.getElementById("res").innerHTML = "111 color is " +  getComputedStyle(lnk[0]).color + "<br /> 222 color is "  +  getComputedStyle(lnk[1]).color;
}