When I use Firefox/IE explorer developer tool to view the DOM, the div is created and the id assigned, but when I try to access it using
document.getElementById("mydiv"), I get the "object is null " error.
I want to set the div's innerHTML and have been tearing my hair over this.
I read somewhere that by just creating the div using "createElement" and setting its id, One cant access it using the document.getElementById property

What gives??How do I access the div??

TinyScript

04-28-2009, 10:32 PM

I think you might have to use setAttribute or it might be that you have to use document.appendchild() before you can access it.

let's see that script! I wanna test it. heheh

TinyScript

04-28-2009, 10:36 PM

here's a link
http://codingforums.com/showthread.php?t=140561
and the code in the thread

smokinguns

04-29-2009, 05:44 AM

hey,
thanx for the prompt replies. I figured the problem. It was a stupid error on my part.