JavaScript Hello World


 

JavaScript Hello World

JavaScript Hello World: This is the first program in JavaScript, and you will learn how to run a simple program of JavaScript in a web browser

JavaScript Hello World: This is the first program in JavaScript, and you will learn how to run a simple program of JavaScript in a web browser

Hello World Program in JavaScript

To write and run a JavaScript program all we need to have a text file and a internet browser. First of all write the following code in a text file and save it with .html file, for now we will embed the JavaScript code within html coding, to display the output in  a browser.

Example 1:

<html>
<head>
<title>My Firt JavaScript File </title>
<script type="text/javascript" >
document.write("Hello World");
</script>
</head>
<body>
</body>
</html>

 

Output:

Hello World

Ads