I find it convenient to set a variable with the same name as an element\'s id, for example:
randomDiv = document.getElementById(\"randomDiv\"); randomDiv.o
randomDiv is not an defined / known "global scope variable".
randomDiv
Declaring global variable