Html Script Tag

In the html <script> tag is used to include java scripts insides of html page. If you need to include external java scripts file to current html page to use src attribute at scripts tag. Commonly we will use JavaScript file for validation for form and dynamic changes content. In the type attribute is optional in html and "async" attribute is new in html.

In the type attribute is optional in html and "async" attribute is new in html and charset attribute is used to encoding character in the script. Which tag details to MIME type of the script.

Syntax:

<script>
  Java scripts ...
</script>

Example Code

<html>
<body>

<script type="text/javascript">
  document.write(" EXample For Java Scripts ... ")
</script>

<body>
</html>

Out Put:



In the above example <script> tag has been added to " Example For Java Scripts" sentence.





Content