I get a warning with the following function:
function getElement(id) {
return document.getElementById(id);
}
Problem at line 2 character 16: ‘document’ was used before it was
defined.
What does this mean?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You will need to assume a browser (
browser: true). Without that, it is treatingdocumentas a regular variable, which is clearly not defined.