JSFiddle - React, Tailwind, and code Playground

HTML

copy from here: <a id="myLink"> myLink </a>
<br><br>
to here: <a id="anotherLink"> myLink </a>

CSS

#myLink{ border:1px solid red; background-color: orange;}

JavaScript

//queriks mode + minor changes to retrive the computed style
function getCS(el)
{
	if (el.currentStyle)
		var y = el.currentStyle;
	else if (window.getComputedStyle)
		var y = document.defaultView.getComputedStyle(el,null);
	return y;
}
function setCS(el,cs)
{
	if (el.currentStyle)
    {
            
        el.currentStyle = cs;
        el.style = cs;
    }
	else if (window.getComputedStyle)
    {el.style = cs 
    }
	
}


var myLink = document.getElementById('myLink');
var anotherLink = document.getElementById('anotherLink');

var CS_myLink = getCS(myLink);
setCS(anotherLink,CS_myLink);