Thursday, 6 October 2016

javascript - document.getElementbyId() returning null

You are executing your javascript code BEFORE the

was actually created.



Also note that you did not close your

with a corresponding
.



So move your javascript code to a part below your HTML. Or execute it after the page finished loading. If you are using JQuery you can do:




No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...