This script cannot find "bannersize" unless I write <div id="bannersize"></div> before the javascript.
The error message:
Error "Uncaught TypeError: Cannot set property 'innerHTML' of null"
My code snippet:
<script>
function dropbox(menu){
this.tmpmenu = document.getElementById(menu);
this.tmpmenu.innerHTML = 'Hello'+this.tmpmenu;
}
bannersize = new dropbox('bannersize');
</script>
<div id="bannersize"></div>