How to link html files and bind the corresponding js within an app?

Hi,
I would like to link from main.html (corresponding main.js) to sub.html (corresponding sub.js) like:

main.html:
<a href="sub.html">Sub</a>

How to do this?
If there´s a smarter way please tell :slight_smile:

if you want to import main.html functionalities in sub.html,then import main.html in sub.js file and make sure this sub.js file is also imported in main.js