---
description: JavaScript is a very powerful client-side scripting language. JavaScript is used mainly for enhancing the interaction of a user with the webpage. In other words, you can make your webpage more lively
title: What is JavaScript? Complete Introduction with Hello World! Example
image: https://www.guru99.com/images/introduction-to-javascript.png
---

 

[Skip to content](#main) 

## What is JavaScript?

JavaScript is a very powerful **client-side scripting language**. JavaScript is used mainly for enhancing the interaction of a user with the webpage. In other words, you can make your webpage more lively and interactive, with the help of JavaScript. JavaScript is also being used widely in game development and[ Mobile ](https://www.guru99.com/mobile-testing.html)application development.

[![Introduction to JavaScript](https://www.guru99.com/images/JavaScript/javascript1_1.png)](https://www.guru99.com/images/JavaScript/javascript1%5F1.png)

## Javascript History

JavaScript was developed by Brendan Eich in 1995, which appeared in Netscape, a popular browser of that time.

[](https://www.guru99.com/images/JavaScript/javascript1%5F2.jpg)

The language was initially called LiveScript and was later renamed JavaScript. There are many programmers who think that JavaScript and[ Java ](https://www.guru99.com/java-tutorial.html)are the same. In fact, **JavaScript and Java are very much unrelated. Java is a very complex programming language whereas JavaScript is only a scripting language**. The syntax of JavaScript is mostly influenced by the programming language C.

## How to Run JavaScript?

Being a scripting language, **JavaScript cannot run on its own. In fact, the browser is responsible for running JavaScript code**. When a user requests an HTML page with JavaScript in it, the script is sent to the browser and it is up to the browser to execute it. The main advantage of JavaScript is that **all modern web browsers support** JavaScript. So, you do not have to worry about whether your site visitor uses Internet Explorer, Google Chrome, Firefox or any other browser. JavaScript will be supported. Also, JavaScript **runs on any operating system** including Windows,[ Linux ](https://www.guru99.com/unix-linux-tutorial.html)or Mac. Thus, JavaScript overcomes the main disadvantages of[ VBScript ](https://www.guru99.com/vbscript-tutorials-for-beginners.html) (Now deprecated) which is limited to just IE and Windows.

### Tools You Need

To start with, you need a text editor to write your code and a browser to display the web pages you develop. You can use a text editor of your choice including Notepad++, [Visual Studio Code](https://www.guru99.com/download-install-visual-studio.html), Sublime Text, Atom or any other text editor you are comfortable with. You can use any web browser including Google Chrome, Firefox, Microsoft Edge, Internet Explorer etc.

### A Simple JavaScript Program

You should place all your JavaScript code within **<script> tags** (<script> and </script>) if you are keeping your JavaScript code within the HTML document itself. This helps your browser distinguish your JavaScript code from the rest of the code. As there are other client-side scripting languages (Example: VBScript), it is highly recommended that you specify the scripting language you use. You have to use the type attribute within the <script> tag and set its value to text/javascript like this:

<script type="text/javascript">

### Hello World Example

<html>
<head>
	<title>My First JavaScript code!!!</title>
	<script type="text/javascript">
		alert("Hello World!");
	</script>
</head>
<body>
</body>
</html>

**Note:** type=”text/javascript” is not necessary in HTML5\. Following code will work.

<html>
<head>
	<title>My First JavaScript code!!!</title>
	<script>
		alert("Hello World!");
	</script>
</head>
<body>
</body>
</html>

## Summary

* [JavaScript](https://www.guru99.com/interactive-javascript-tutorials.html) is a **client-side scripting language** developed by Brendan Eich.
* JavaScript can be **run on any operating systems** and almost all web browsers.
* You need a text editor to write JavaScript code and a browser to display your web page.

This code is editable. Click Run to Execute  

#### Summarize this post with:

ChatGPT Perplexity Grok Google AI 

**Stay Updated on AI** **Get Weekly AI Skills, Trends, Actionable Advice.** 

##### Sign up for the newsletter

Subscribe for Free 

You have successfully subscribed.  
Please check your inbox. 

![AI-Newsletter]() Chosen by over **350,000+** professionals 

[Scroll to top ](#wrapper)Scroll to top 

× 

Toggle Menu Close 

Search for: 

Search

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.guru99.com/#organization","name":"Guru99","sameAs":["https://www.facebook.com/Guru99Official","https://twitter.com/guru99com"],"logo":{"@type":"ImageObject","@id":"https://www.guru99.com/#logo","url":"https://www.guru99.com/images/guru99-logo-v1-150x59.png","contentUrl":"https://www.guru99.com/images/guru99-logo-v1-150x59.png","caption":"Guru99","inLanguage":"en-US"}},{"@type":"WebSite","@id":"https://www.guru99.com/#website","url":"https://www.guru99.com","name":"Guru99","publisher":{"@id":"https://www.guru99.com/#organization"},"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https://www.guru99.com/images/introduction-to-javascript.png","url":"https://www.guru99.com/images/introduction-to-javascript.png","width":"759","height":"353","inLanguage":"en-US"},{"@type":"BreadcrumbList","@id":"https://www.guru99.com/introduction-to-javascript.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":"1","item":{"@id":"https://www.guru99.com","name":"Home"}},{"@type":"ListItem","position":"2","item":{"@id":"https://www.guru99.com/javascript","name":"JavaScript"}},{"@type":"ListItem","position":"3","item":{"@id":"https://www.guru99.com/introduction-to-javascript.html","name":"What is JavaScript? Complete Introduction with  Hello World! Example"}}]},{"@type":"WebPage","@id":"https://www.guru99.com/introduction-to-javascript.html#webpage","url":"https://www.guru99.com/introduction-to-javascript.html","name":"What is JavaScript? Complete Introduction with Hello World! Example","dateModified":"2024-03-09T15:00:01+05:30","isPartOf":{"@id":"https://www.guru99.com/#website"},"primaryImageOfPage":{"@id":"https://www.guru99.com/images/introduction-to-javascript.png"},"inLanguage":"en-US","breadcrumb":{"@id":"https://www.guru99.com/introduction-to-javascript.html#breadcrumb"}},{"@type":"Person","@id":"https://www.guru99.com/author/james","name":"James Hartman","description":"I am James Hartman, a seasoned professional in Oracle Certified Java Professional tutorials, specializing in crafting comprehensive guides to help you excel in your Java certification journey.","url":"https://www.guru99.com/author/james","image":{"@type":"ImageObject","@id":"https://www.guru99.com/images/james-hartman-author-v2-120x120.png","url":"https://www.guru99.com/images/james-hartman-author-v2-120x120.png","caption":"James Hartman","inLanguage":"en-US"},"worksFor":{"@id":"https://www.guru99.com/#organization"}},{"@type":"NewsArticle","headline":"What is JavaScript? Complete Introduction with Hello World! Example","keywords":"javascript, java","dateModified":"2024-03-09T15:00:01+05:30","articleSection":"JavaScript","author":{"@id":"https://www.guru99.com/author/james","name":"James Hartman"},"publisher":{"@id":"https://www.guru99.com/#organization"},"description":"JavaScript is a very powerful client-side scripting language. JavaScript is used mainly for enhancing the interaction of a user with the webpage. In other words, you can make your webpage more lively","copyrightYear":"2024","copyrightHolder":{"@id":"https://www.guru99.com/#organization"},"name":"What is JavaScript? Complete Introduction with Hello World! Example","@id":"https://www.guru99.com/introduction-to-javascript.html#richSnippet","isPartOf":{"@id":"https://www.guru99.com/introduction-to-javascript.html#webpage"},"image":{"@id":"https://www.guru99.com/images/introduction-to-javascript.png"},"inLanguage":"en-US","mainEntityOfPage":{"@id":"https://www.guru99.com/introduction-to-javascript.html#webpage"}}]}
```
