javascript hello world program : intro

Posted under javascript sample code On By mohammed.mutawe

JavaScript hello world program

JavaScript is a language that is used in many fields, but we as programmers know that JavaScript is the language of the web and put all our efforts on using it in web technologies.

 

Definition

Using or source code from JavaScript is very easy if you have prior knowledge in HTML and we will build a javascript hello world program in HTML page to print the famous phrase Hello World to become :

<html>
<body>

<script type="text/javascript">
document.write("Hello World!");
</script>

</body>
</html>

 

The idea is not in phrase Hello World, but in the way to call JavaScript code. All we need is two HTML tags and then two script tags in order to read all the JavaScript data. Without that, the program will not work, and so the result will be JavaScript hello world program.

 

Important

Do not forget that document.write statement is very important in JavaScript when printing the results and you will see its importance when used in large programs.

 

References

  • Third edition JavaScript Book.

Leave a comment

Your email address will not be published. Required fields are marked *