Web Building Blocks Intermediate

What Is JavaScript?

JavaScript is the code that makes a web page interactive.

Infographic: What Is JavaScript? It shows how JavaScript makes a page interactive, responding to clicks and updating content.
Download the poster

HTML builds a page and CSS makes it pretty, but JavaScript is what makes it actually do things.

JavaScript is the programming language of the web, and it runs right in your browser.

It makes pages interactive and alive. It can update content without reloading, respond when you click, animate things, check forms, and fetch new data.

For example, when you click a button and something pops up or changes, that is usually JavaScript at work.

It can do a lot, so it has the usual coding tools: variables to remember things, ways to make decisions, and loops to repeat steps.

Together with HTML and CSS, JavaScript completes the web: structure, style, and behavior, all working as one.

What to remember

  • JavaScript makes a web page interactive.
  • It runs in your browser.
  • It can respond to clicks, animate, and fetch data.
  • HTML, CSS, and JavaScript build the whole web.

Words to know

JavaScript
The programming language that makes web pages interactive.
Variable
A named place to store a value.
Event
Something that happens, like a click, that code can react to.
DOM
The page seen as objects that JavaScript can change.

For grown-ups

JavaScript is the web's programming language, executing in the browser to manipulate the DOM, handle events, animate, validate input, and call APIs (fetch). With HTML and CSS it forms the core trio. Modern JS also runs servers (Node.js) and powers frameworks, but its defining role is client-side interactivity.

Want the full story? These go deeper: