how to add javascript to html

JavaScript
<script src="myScript.js"></script>
<script type="text/javascript" src="yourfile.js"></script><script>
	//JavaScript here
</script><script>

document.getElementById("demo").innerHTML = "My First JavaScript";

</script>
 <script>
	// JS Here  
</script><script src = "index.js"></script>
Source

Also in JavaScript: