Home > Net >  JavaScript Document is not defined, WebStorm IDE
JavaScript Document is not defined, WebStorm IDE

Time:12-09

I started up learning some basic HTML, CSS and JS and reached the point where I should be able to connect them. But when I'm trying to access the document object it just says that the document is not defined

app.js

index.html

error

I've tried changing the IDE, done some research on the internet and I found that it might be NodeJS, since it's more server based and not browser based, but even so how can I fix this ?

CodePudding user response:

You need to open the html document directly in the browser and not run it via Webstorm, cause Webstrom thinks you are writing node and in node document is not defined.

Here's a link to the JetBrains Docs for information on how to debug vanilla js code: Docs

  • Related