How to make width equaled to height into CSS rule using pure JS? May be, there is a solution in CSS.
CSS
#animation-2 > div.line {
height: 10%;
background: red;
}
JS
let line = document.querySelector('.line');
let height = line.offsetHeight;
document.querySelector('.line').style.width = height;
It doesn't work. I want value in pixels. May I forget to add something?
THanks