What is JavaScript?

JavaScript lets websites do things when you interact with them, like clicking buttons or filling in forms.

Think of it like this

JavaScript is the brain that reacts when you poke the website.

What's happening

Diagram showing JavaScript responding to a user click and updating the page content

Summary

JavaScript makes websites interactive.

A Closer Look

JavaScript is a programming language that adds interactivity and dynamic behavior to web pages. It runs in web browsers and allows websites to respond to user actions, update content without reloading, validate forms, create animations, and build complex web applications.

Common Misconceptions

  • JavaScript and Java are completely different languages โ€” they just share part of a name for historical marketing reasons.
  • JavaScript isn't only for websites โ€” it also runs on servers (Node.js) and in apps.
  • JavaScript doesn't need to be downloaded โ€” it's already built into every modern web browser.

How it connects

JavaScript works on top of HTML and CSS, and reaches out to other systems:

Try it yourself

Press F12 to open the browser console, type document.title and press Enter. JavaScript just read this page's title for you.