You can place <script> tag in HEAD element of the HTML document. The <script> in the head element executes when you perform some action.
Example: when you click a button.
Demo
Let's create a document called ScriptInHead.html
Syntax: The syntax for placing snippets in the HEAD section is.

- <HEAD>
- <SCRIPT type=”text/javascript”>
- Script goes here
- </SCRIPT>
- </HEAD>


Aarthna MaheshwariPosted Apr 28, 2015, 10:55 PM
Santhakumar Munuswamy Thanks for your reviews!
Santhakumar MunuswamyPosted Apr 28, 2015, 2:44 PM
Nice