document.getElementById null error

If you keep getting this error it is because the element ID truly is null.  But you say “But it’s write here on the page with a DIV id on it!”? Well you’re probably doing what I did – calling the getElementById before the DIV exists in the normal flow of the page. Put your call in a function call after the DIV on the page (not in the page header) and the issue goes away.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>