Table of Contents
The Script Tag
The script tag requires two critical elements:
- Between the html body tag
- Between the html head tag
Demo Example 1: written without semicolons
However, semicolons must be used when formatting in a single line, as seen below.
Demo Example 2: written withsemicolons
- Any text between the symbols /* and */ is considered a comment. This might span several lines.
The code will give following result:
If you have noticed earlier we have used:
<script> alert('Hello, World!'); </script>
When you’ll run that program, you will get a pop-up notification saying: Hello World!