JavaScript Introduction

JavaScript is a client-side scripting language. Javascript code is downloaded from the server and executed on client’s browser.

We can include javascript statements in html file or we can create a javascript file and can import it on html files.

In html file we can use script tag to write javascript statements.

Syntax

we can write script tags inside the head or inside the body section.

Example

Result

We can also put script tag inside body generally we include as last statement of body

Java Script Tutorial

Result

Here document refers to body of browser and write() is a function used to write the content on browser body.

We can create a separate javascript file and can include that file in html
We have a javascript file names myJavaScript.js

Same folder having file first.html