Error in Document.getElementById() in Brackets

Asked

Viewed 193 times

0

You are giving this error in the image when I use "Document". Does anyone know how to fix it? I already searched right here in the stack and found nothing to help me. Detail, I’m using the Brackets.

inserir a descrição da imagem aqui

  • Henrique, could you post the code? With an image and only a piece of code it’s a little difficult to help you. The more information you provide, the more chances you have of getting a good response.

  • Checks whether Brackets has syntax checking for HTML or Javascript in the lower right corner if it is not changing.

  • What extensions you have installed in Brackets?

  • Thanks for your help, that’s what Sergio said below! Thank you all!

1 answer

4


This warning is from the program that checks the syntax of the code, one of the most popular (and maybe what you have) is Eslint.

This error should be ignored if this code is to run in the browser because document is a global browser.

To fix this goes to the Eslint configuration file and joins

env: {
    browser: true,

to tell linter that this code runs in the browser

Browser other questions tagged

You are not signed in. Login or sign up in order to post.