No, JS should always be executed in the body tag after all of the mark-up..
<!-- all mark-up for browser display -->
Since my example uses document.getElementsByClassName('class'), I am assuming there is an element with the class of 'class'. If used in the <head> section or anywhere before '<div class="class">' is seen (the browser reads from top to bottom), then it will be an empty list- as it wont see the elements if it is used before the elements are there.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)