Saturday, June 8, 2019

javascript - getElementById() returns null even though the element exists




I'm trying to get the element with getElementById(), but it returns null even though the element exists. What am I doing wrong?





blah











Answer




You have to put this in a document load event. The DOM hasn't gotten to abc by the time the script is executed.


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...