Hello World: JavaScript

JavaScript is useful to improve the layout of an HTML page giving the programmers to create a page of choice based on various parameters (dyanamically). A simple javascript function will look like

<head>
<title>Hello World in JavaScript</title>
</head>
<body>
<script type="text/javascript">
<!--
document.write("Hello World!");
-->
</script>
</body>

Now open your browser and enter the path where you have stored this file

file:///home/user/js/helloWorld.html

and the output will be displayed in the browser

Hello World!
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s