SyntaxFix
Write A Post
Hire A Developer
Questions
document.getElementById('something') can be 'undefined'. Usually (thought not always) it's sufficient to do tests like if (document.getElementById('something')).
if (document.getElementById('something'))