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>.

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.
Write for us
DelftStack articles are written by software geeks like you. If you also would like to contribute to DelftStack by writing paid articles, you can check the write for us page.