Start using Javascript

If you want to use javascript in you website, you can put your code inside "script" tag and connect it to your page inside "head" or "body" tag. More developers use it inside "body" tag.

Here is an example:

<!DOCTYPE html>
<html>
    <head>
        <script>
            //...

        </script>
    </head>
    <body>
       //...
    </body>
</html>
<!DOCTYPE html>
<html>
    <head>
    </head>
    <body>
       //...
       <script>
           //...

       </script>
    </body>
</html>

The easier and righter way to use your javascript with ".js" file you can create ".js" file in whatever folder you want and connect it to your web application. You can do it with "script" tag putting it in "head" or in "body" tag.

Here is an example:

<!DOCTYPE html>
<html>
    <head>
         <script type="text/javascript" src="path/yourJsFile.js"></script>
    </head>
    <body>
       //...
    </body>
</html>
<!DOCTYPE html>
<html>
    <head>
    </head>
    <body>
       //...
       <script type="text/javascript" src="path/yourJsFile.js"></script>
    </body>
</html>

Javascript scopes define as "UpToDown". When you've created a javascript and declared some variables or functions, these will be able to use in javascript, which is under that script. More about script tag Script Tag .