JavaScript Tutorial - Hello World

  1. JavaScript Hello World
  2. Basic JavaScript Syntax Rules

In this tutorial, we’re going to do a simple Hello World program in JavaScript as the starting point of our JavaScript tutorial.

JavaScript Hello World



  <p>JavaScript Tutorial</p>

    alert( 'Hello, world!' );


	alert( 'Hello, world!' );

When we embed JavaScript in a web page, we always have to embed it within the script tags <script>...</script>.

5 Wonderful things you can do with ...
5 Wonderful things you can do with Javascript
alert( 'Hello, world!' );

It is simply an alert with information Hello World! within the parenthesis, and then it ends with a semicolon.

If you save the above code to a file named like helloworld.html and then view it in a browser, you will get a pop-up box saying Hello world!.

Basic JavaScript Syntax Rules

Before we continue to learn JavaScript further, we should get some basic syntax rules of this scripting language.

  • JavaScript is case sensitive. It is valid for both variables and functions.
  • Each statement ends with a semicolon.