Javascript Tips #3 : Always include Your JavaScript Code in Script Tag.

Note down following things -

  1. The <script> tag is used to define JavaScript.
  2. The <script> element contains scripting statements, or it can refer an external script file using the src attribute.
  3. Common uses for JavaScript are image manipulation, form validation, and dynamic changes of content.

Example :

<html>
    <body>
        <script>
            document.write("Hello World!")
        </script>
    </body>
</html>

The <script> tag is supported in all major browsers.