#Inner HTML Issues

5 messages · Page 1 of 1 (latest)

wild crane
#

It's not saying width is null. It's saying you're trying to set innerHTML on null, which you cannot do. Specifically it says you're attempting to set properties of null.

#

So for whatever reason it can't find an element with id my_div

#

This is likely because your js is run before the body element is rendered. You'll need to move your JavaScript to some place after the div. This way the div will have been rendered and exist in the DOM.

velvet raven
#

it works!

wild crane
#

Awesome