The <script> tag is used to define a client-side script (JavaScript).
The <script> element either contains scripting statements, or it points to an external script file through the src attribute.
The script tags are two important attributes −
Type − This attribute is what is now recommended to indicate the scripting language in use and its value should be set to “text/javascript”.
Language − The basic form of the language attribute is very easy to implement. Simply shove in the keyword “language=”, followed by “JavaScript“, into your <script> tag.
JavaScript Comments
The purpose of a comment is to describe or explain the program:-
JavaScript uses C style and C++ style comments for both single-line and block comments.
A single comment starts with two forward slashes. (//).
A block comment starts with a forward slash and asterisk (*/) and closing tag (/*).
JavaScript Syntax- Tutorialpath
JavaScript Syntax
The
<script>
tag is used to define a client-side script (JavaScript).The
<script>
element either contains scripting statements, or it points to an external script file through thesrc
attribute.The script tags are two important attributes −
JavaScript Comments
The purpose of a comment is to describe or explain the program:-
JavaScript uses C style and C++ style comments for both single-line and block comments.
A single comment starts with two forward slashes. (//).
A block comment starts with a forward slash and asterisk (*/) and closing tag (/*).