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.



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 :


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



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.



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.



  • Third edition JavaScript Book.

Leave a comment

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