How do I enable a custom JS file in my Drupal site?
There are several ways to add JS files to Drupal, depending on the requirements.

If the JS is related to your theme and used on every page, perhaps easiest to add the file to your theme's .info file


create the JS file in mytheme/custom-js.js and configure it for the theme in mytheme.info

scripts[] = js/custom-js.js
Flush all caches to register the new JS file.


More info: https://www.drupal.org/node/756722