Relative Content

Tag Archive for javascriptes6-modules

How to access a variable or function in an HTML file after importing them into a main.js

I am trying to include multiple JS files into one main JS file (called main.js) and include that into my HTML file. One of those JS files have a set of variables (called variables.js) I want to use in my HTML file. I came across using the import/export modules so I tried to put this to use. While I was able to access the variables from variables.js within my main.js file, I am not able to access them in my HTML file. Everytime I run the code, I keep getting the following error: