I have a javascript file that is beaing loaded last. In the file this code is executed:
var x = document.getElementById("bildfram1").offsetHeight;
document.getElementsByTagName("header").style.top = "calc(x/2)";
But I get this error in the console:
Uncaught TypeError: Cannot set property 'top' of undefined
Any help on how to fix this! Thanks in advance!