What is JavaScript?

Understand how JavaScript brings web pages to life with interactivity and dynamic behavior.

Step 1 of 4

Why does JavaScript exist?

In 1995, web pages were static documents — like printed posters pinned to a wall. You could read them, click links to go to other pages, but that was it. There was no way for the page to respond to you.

Netscape (the most popular browser at the time) hired Brendan Eich to create a programming language that could run inside the browser. In just 10 days, he created JavaScript. The goal was simple: let web pages react to what users do.

JavaScript is the behavior layer of the web. While HTML provides structure and CSS provides style, JavaScript provides interactivity. It can:

  • Respond to clicks, key presses, and mouse movements
  • Show and hide content without reloading the page
  • Validate forms before submission (is that a real email address?)
  • Fetch new data from a server in the background
  • Create animations, games, and complex applications

Today, JavaScript is the most widely used programming language in the world. Every major website — Google Maps, Gmail, Netflix, Spotify's web player — depends on it heavily.

Think of it this way: If a website were a car, HTML would be the body and frame (the structure), CSS would be the paint job and interior design (the appearance), and JavaScript would be the engine and electronics (what makes it actually do things when you press the gas pedal or turn the steering wheel).
Web Standard
Despite the name, JavaScript has nothing to do with the Java programming language. It was named 'JavaScript' as a marketing decision because Java was popular in 1995. The official name of the language standard is ECMAScript (maintained by Ecma International).