Why IntelliJ Idea doesn't recognize the dollar operator of JQuery?

Ali Tor picture Ali Tor · May 5, 2016 · Viewed 10.4k times · Source

IntelliJ shows a warning "Unresolved function or method $()" when mouse over the $ sign despite the file is in the same directory as js file. So I can't take advantage of intellisense when typing $ functions.

Just one line of code and the IDE didn't recognize it. But it works. How can I fix this problem?

$(".container").get(0).appendChild(proDiv);

Answer

Ali Tor picture Ali Tor · May 5, 2016

I have found the solution by myself.

  1. First press CTRL + ALT + S and go to settings.
  2. Then click from the menu Languages & Frameworks
  3. Select JavaScript from the section below and select Libraries
  4. In the open menu on the right, click on the Download button and select jquery from the list.
  5. Download it and apply. It is done.

downloading a library with IntelliJ