JS onclick function passing external file

I have a menu which is plain HTML In there I have some images. When you click on those an action should be preformed (for example opening or closing the menu). This plain HTML menu is included by PHP.

To preform an action, I thought adding the JS onclick=”” tag to my HTML would be a good idea. Now I have created some .js files that are in a subdirectory called js.

Now is my question how to pass the .js files located in the subdir to the onclick=”” tag.

(TLDR)

/index.php <- there is the navigation bar inside

/js/file.js <- want to access this file via onclick=”” in index.php

How can I do that