Hello coders,
I dont know any javascript yet but I would just like to know how to do one thing. Im using a bit of code to find the height of a <div> which is different depending on the amount of content it contains.
This is the code im using and its working fine:
Code:
<script language="javascript">
onload=function() {
var divh = document.getElementById('main-content').offsetHeight;
var divh = divh + 200;
// alert(divh +"px");
// document.write(divh);
}
</script>
So heres the thing, what I need to do is take the value in the variable
divh and echo it into the page as an inline css height attribute.
So for example:
Code:
<div style="height:<javascript value here>px;">
Site Content
</div>
Any help would be greately appreciated.
Thanks, R404