Check out example codes for "javascript in html". It will help you in understanding the concepts better.

Code Example 1

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

Code Example 2

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

Code Example 3

	// JS Here  

Code Example 4

<script type="text/javascript">
  alert("This alert box was called with the onload event");

Code Example 5

	//JavaScript here

Learn ReactJs, React Native from