Lesson 1 of 22 – Introduction to JavaScript
5%

Introduction to JavaScript

JavaScript is one of the most popular programming languages used to create interactive and dynamic web pages. It helps developers make websites more attractive and user-friendly.

Note: JavaScript works together with HTML and CSS to build modern websites and web applications.
What is JavaScript?

JavaScript is an open-source scripting language that runs inside web browsers. It allows developers to create dynamic content and interactive web pages.

  • JavaScript can change HTML content.
  • JavaScript can change CSS styles.
  • JavaScript can modify HTML attributes.
  • JavaScript can hide and show HTML elements.
  • JavaScript can validate forms.
  • JavaScript can create animations.
  • JavaScript can control multimedia.
  • JavaScript can communicate with web servers.
History of JavaScript

JavaScript was developed by Brendan Eich while working at Netscape.

Feature Information
Developer Brendan Eich
Company Netscape
First Release 1995
Standard ECMAScript
Type High-level scripting language
Features of JavaScript
  • Lightweight programming language.
  • Easy to learn.
  • Object-oriented.
  • Platform independent.
  • Case-sensitive language.
  • Interpreted language.
  • Supports event-driven programming.
  • Works on all major browsers.
JavaScript Engine

A JavaScript engine is a program that reads, interprets, and executes JavaScript code. Every modern web browser has its own JavaScript engine.

The JavaScript engine also performs memory management and optimizes code execution for better performance.

Browser JavaScript Engine
Google Chrome V8
Microsoft Edge V8 (Chromium)
Mozilla Firefox SpiderMonkey
Safari JavaScriptCore (Nitro)
Opera V8
Popular Web Browsers

JavaScript runs inside web browsers. Most computers and smartphones already have a browser installed.

  • Google Chrome
  • Microsoft Edge
  • Mozilla Firefox
  • Safari
  • Opera
  • Brave Browser
The HTML <script> Tag

The <script> tag is used to add JavaScript code to an HTML document.

JavaScript can be written inside the HTML file or linked as an external file.

Example:
<script>
document.write("Welcome to JavaScript");
</script>

The browser executes the JavaScript code and displays the output.

First JavaScript Program

The following example displays a message using JavaScript.

<script>
alert("Hello World!");
</script>
Output:
Hello World!

The alert() function displays a popup message box.

Advantages of JavaScript
  • Easy to learn and use.
  • Makes web pages interactive.
  • Runs on all modern browsers.
  • Fast execution.
  • Supports client-side programming.
  • Can communicate with web servers.
  • Used in web and mobile application development.
  • One of the most popular programming languages.
Key Points
  • JavaScript is a scripting language.
  • It makes web pages interactive.
  • JavaScript works with HTML and CSS.
  • It runs inside web browsers.
  • Brendan Eich developed JavaScript in 1995.
  • ECMAScript is the standard version of JavaScript.
  • The <script> tag is used to add JavaScript to HTML.
  • JavaScript is widely used for web development.

🧠 Quick Quiz

Who developed JavaScript?