Html 5 Script Tag

In the html5 <script> tag is used to include java scripts inside 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 5 and "async" attribute is new in html5.

In the type attribute is optional in html 5 and "async" attribute is new in html5 and charset attribute is used to encoding character in 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