Programming words

What is JavaScript?

JavaScript gives a page its motion. It is the code that runs when a button is pressed, a list changes, or data arrives.

  • It runs in the browser. You do not have to install a separate program.
  • It can also run on a server. That is called Node.
  • HTML is structure, CSS is appearance, JavaScript is motion.

When you bind click to a button, you can count the presses. If JavaScript is turned off, the button is still visible, but it does no work. The structure of the page still stays in HTML.

Tool for this topic

Related guides

About this tool

JavaScript gives a page its motion. It is the code that runs when a button is pressed, a list changes, or data arrives. It runs in the browser. You do not have to install a separate program. It can also run on a server. That is called Node. HTML is structure, CSS is appearance, JavaScript is motion.

When you bind click to a button, you can count the presses. If JavaScript is turned off, the button is still visible, but it does no work. The structure of the page still stays in HTML.

How to use it

  1. Create a new HTML file and add a `<script>` tag.
  2. Write JavaScript code inside the `<script>` tag or link an external `.js` file.
  3. Add an event listener with `addEventListener` to capture button clicks.
  4. Test the code by refreshing the page and clicking the button.

Common uses

Frequently asked questions

What is JavaScript?

JavaScript is a programming language that gives web pages motion, running in browsers and on servers via Node.

What is Node?

Node.js is a runtime that allows JavaScript to run on the server side.

What happens if JavaScript is disabled?

The page remains visible, but interactive features do not work; the HTML structure stays.