Check out example codes for "how to link js to html". It will help you in understanding the concepts better.

Code Example 1

<script type="text/javascript" 

Code Example 2

<script src="index.js"> </script>

Code Example 3

<script src="Your-JavaScript-File.js"></script> <!--If JS file is in same folder with HTML file-->

Code Example 4

<script src="myscripts.js"></script>

Code Example 5

<script type="text/javascript" src="/path/to/script.js"></script>

Code Example 6

<script type="text/javascript" src="path-to-javascript-file.js"></script>

Learn ReactJs, React Native from