I'm trying to set the height of a div to the same as the width of it. Example:
The width is set to 50% and the screen is 1000px wide, the element will be 500px wide. I want the height to be the same; 500px.
var layer=document.getElementById('layer'); var layer_width=layer.width(); layer.style.height=layer_width;
The width of 'layer' has been set to 50% in CSS. The height is unaffected however. What am I doing wrong