J

JavaScript Tutorial

Clean • Professional

What is JavaScript

1 minute

What is JavaScript ?

JavaScript is a high-level, interpreted programming language that allows you to make web pages interactive and dynamic. Alongside HTML and CSS, it is one of the core technologies of web development.

  • HTML → Builds the structure of a webpage (headings, paragraphs, buttons).
  • CSS → Adds style and design (colors, fonts, layouts).
  • JavaScript → Adds behavior and interactivity (clicks, animations, live updates).

Who Created JavaScript?

  • JavaScript was created by Brendan Eich in 1995 at Netscape Communications Corporation.

  • Initially called Mocha, then LiveScript, and finally JavaScript.
  • Remarkably, it was developed in just 10 days!

Why Use JavaScript?

JavaScript is used for:

  1. Interactive Web Pages – Respond to user actions like clicks, hover, or form submissions.
  2. DOM Manipulation – Dynamically change HTML content or CSS styles.
  3. Web Applications – Build apps like Gmail, Facebook, or e-commerce websites.
  4. Server-Side Development – Use Node.js for backend tasks like APIs and databases.
  5. Games and Animations – Create browser games and animations.
  6. Event Handling – React to keyboard, mouse, or page events.

Example:

<!DOCTYPE html>
<html>
<head>
  <title>JavaScript Example</title>
</head>
<body>
  <h1 id="greeting">Hello!</h1>
  <button onclick="changeText()">Click Me</button>

  <script>
    // JavaScript function to change text dynamically
    function changeText() {
      document.getElementById('greeting').innerText = "Hello, JavaScript!";
    }
  </script>
</body>
</html>

 

Article 0 of 0