WebStorm is not highlighting properly JS code whether its in HTML file or in JS file. It says unresolved variable or type document when I want to get ID of element using document.getElementByiD.

I have also captured settings


3 Things to try:
File | Invalidate Caches and restart IDE. (credits @LazyOne)File -> Settings > Editor -> File Types, select JavaScript into list of file types and check if you have *.js into list of extensions below. Alternatively try to create new draft (Shift+Ctrl+Alt+Ins) for JavaScript language and take a look if it get highlighted. (credits @Flying)File | Settings | Languages & Frameworks | JavaScript and Choose ECMAScript 5.1 and press ok. Files shoud now be highlighted correctly. Then, open the menu again and re-select ECMAScript 6+.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With