JSFiddle - React, Tailwind, and code Playground
HTML
<div class="someDiv" style="width:900px;height:200px; background:#000">
<a class="someAnchor" style="display:block; float:left; width:35%; background:green"></a>
</div>
JavaScript
var anchor = document.querySelector(".someDiv .someAnchor");
var astyle = window.getComputedStyle(anchor);
//anchor.style.height = astyle.width; //this will make it static though
//to make it a percentage like width so it will expand and contract with resize of parent element
var pstyle = window.getComputedStyle(anchor.parentNode);
var pheight = parseInt(pstyle.height);
var awidth = parseInt(astyle.width);
anchor.style.height = ((awidth/pheight)*100)+"%";