// this how add javascript file in html !!
<script type="text/javascript" src="yourJavascript.js"></script>
<!-- include an external javascript document -->
<script src="myJavaScript.js" charset="utf-8"></script>
<!-- JavaScript inside html element -->
<script>
console.log("This is JavaScript");
</script>
<script>
function alert () {
alert("Javascript has started");
}
</script>
<script>
document.getElementById("demo").innerHTML = "Hello JavaScript!";
</script>