Import Variables

JavaScript Variables and Strings can be exported from 1 JS file to another using the Export and Import commands.

Import a basic string -

Import a 2nd string -

Rangers Wins
Celtic Wins
Man United Championships

The Championship win numbers are listed in the exports.js file and then a seperate js file (imports.js) imports them, where 'get element by ID' is used to be able to output them on the page.

The script type in the import.js file must be defined as a 'module'