I want to use javascript to get the height of a responsive div, and use the output in another div. But I'm no good in javascript at all...
So far I've come up with:
<script language="JavaScript">
var offsetHeight = document.getElementById("myDiv").offsetHeight;
var curr_width = parseInt(offsetHeight.style.height);
offsetHeight.style.height = (offsetHeight);
</script>
<div id="mydiv"></div>
<div id="offsetHeight" style="top:0px"></div>
So what I want is that when I resize the document, the height of mydiv
is used for the style="top"
value...
Anyone who can help me out? Would be wonderful!
` tag..And while setting height, it should be `offsetHeight+'px'`
– Rayon Mar 08 '16 at 11:02