+ 3
Why does document.getElementById only work if the js is inside the script-tag and not external?
3 Antworten
+ 4
if it is external, it needs to be in a window.onload function, any script needing 'document' before doesnt load until the DOM, or page elements, load
+ 1
why would it work when its a part of JavaScript
+ 1
any JavaScript outside the script function will simply not work