Example 1:
JavaScript in <head> or <body>
You can place any number of scripts in an HTML code document. Scripts code can be placed in the <body> , or in the <head> part of an HTML web page, or in both.
<script type="text/javascript" src="add_members.js"></script>
Example 3:
<script type="text/javascript">
alert("This alert box was called with the onload event");
</script>
where is the correct place to insert a javascript
You can place any Java script source code in the <body>, or in the <head> part.
I hope you get an idea about where is the correct place to insert a javascript head or body?.