Does anyone have any ideas as to why this code isn't working properly? I am trying to set a dynamic height for a fixed width div that might extend below the viewport.
<script type="text/javascript">
function adjustHeight() {
var div = document.getElementById('bg');
var height = document.scrollHeight;
div.style.height = height + 'px';
}
</script>
</head>
<body onload="adjustHeight()">
<div id="bg">
If there is no solution, does anyone know of an alternative approach? Any assistance would be greatly appreciated. Thank you