What Is WordPress? The Software Is Free, but a Website Still Costs Real Money
What is WordPress, what does a website really cost, and should you choose WordPress.org or WordPress.com?
You click “Add to cart” on an online shop and wonder: what is JavaScript? The number on the cart jumps from 0 to 1 at once, without reloading the page. You type an email address missing the @ sign, and a red line appears under the field before you even press submit. A menu on your phone opens when you tap the three-line icon. All three share one thing: the page knows what you just did and answers right away. The part doing that work is JavaScript.
Quick summary
- JavaScript is the programming language that makes web pages respond to what you do, alongside HTML for structure and CSS for appearance.
- The browser runs JavaScript with a built-in engine, which turns code into machine code as it runs and updates the page through the DOM.
- The same language also runs on servers, thanks to Node.js, released in 2009.

JavaScript is the programming language that makes a web page respond to what you do. According to MDN, JavaScript is the third layer of the three standard web technologies, after HTML and CSS. HTML builds the frame of the page, CSS decides how the page looks, and JavaScript decides what the page does when you touch it.
One button shows how the three layers split the work. HTML creates the button, CSS gives it color and rounded corners, and JavaScript decides what happens when you click it. Without JavaScript, a page still shows text and images, but every button, input field, and menu sits still.

JavaScript is a scripting language, which means code is turned into machine code as it runs, instead of being compiled first into a separate executable file. Modern JavaScript engines use just-in-time compilation to run faster than the old way of translating line by line. Every popular browser has one of these engines built in.
JavaScript is everywhere. According to W3Techs, as of 2025, 98.9% of websites use JavaScript for client-side behavior. In the Stack Overflow Developer Survey 2025, JavaScript was the most used language, with 66% of respondents saying they had used it in the past year, holding that spot for the 13th year in a row. That number measures self-reported use, not hiring demand, but it shows that a newcomer to web development will almost certainly meet JavaScript first.
The browser does not run JavaScript code in a vague way. According to AWS, the process has five steps: the browser loads the page and builds the DOM, the JavaScript engine turns the code into machine code, an event such as a mouse click triggers the code attached to it, the engine runs that code and changes the DOM, and the browser redraws the part of the page that changed.
The DOM, short for Document Object Model, is a tree-shaped map of the page that code can read and change. Each HTML tag becomes a node on that tree. When JavaScript changes a node, the browser redraws only that spot, and the rest of the page stays as it is. That is why the cart number goes up without reloading the page.
Each browser has its own JavaScript engine: Chrome and Edge use V8, Safari uses JavaScriptCore, Firefox uses SpiderMonkey. The JavaScript you write runs on all three, because they all follow the same language standard. JavaScript in the browser can only touch what the browser allows, for example it cannot write straight to your hard disk unless you click download. That limit is deliberate: the code runs on the reader’s machine, so the browser has to keep it inside a safe boundary.
You need to install nothing to try JavaScript. Open any web page, press F12, and pick the Console tab. The blinking cursor there is where you type code and see the result at once. Type this line and press Enter:
2 + 3
The console returns 5. Nothing impressive yet, but you just ran real JavaScript in your own browser. Now try an example closer to real work: adding up a shopping cart. Suppose a small shop sells coffee and milk tea, and the cart holds two items. Type this code into the console:
const cart = [
{ name: "Arabica coffee", price: 45000, quantity: 2 },
{ name: "Milk tea", price: 35000, quantity: 1 },
];
let total = 0;
for (const item of cart) {
total += item.price * item.quantity;
}
console.log(total);
The console prints 125000. Each line does one small job: const cart holds the list of items, each with a name, a price, and a quantity; let total = 0 sets the starting total to zero; the for loop walks through each item and adds price times quantity to the total; console.log(total) prints the total on screen. Check it by hand: 45,000 times 2 is 90,000, plus 35,000 is 125,000, which matches what the code printed. Prices are in Vietnamese dong. This code was actually run with Node.js version 24.22.1 on 3 December 2026, and the result was exactly 125000.
JavaScript in the browser can also read the page you are looking at. Type this line into the console of any page:
document.querySelectorAll("a").length
The console returns the number of links on that page. document is the doorway into the DOM, querySelectorAll("a") picks every link tag, and .length counts them. In the same style, you can pick a button and attach a response to it:
const button = document.querySelector("button");
button.addEventListener("click", () => {
console.log("You just clicked the button");
});
This code tells the browser: when someone clicks the first button on the page, print that line to the console. addEventListener is how JavaScript listens for events, and “event” is the central idea of the language: the code sits and waits for the user to do something, then responds.
The similar names lead many newcomers to think JavaScript is a cut-down version of Java. The two languages differ in design, according to both Wikipedia and MDN. The name JavaScript was partly a marketing decision by Netscape, because Java was rising fast at the time.
| JavaScript | Java | |
|---|---|---|
| Typing | Dynamic typing, variables need no type declared in advance | Static typing, variables must declare their type |
| How it runs | Turned into machine code as it runs, in the browser or on a server through Node.js | Compiled first into bytecode, run on the Java Virtual Machine |
| Where it is used | Mainly interactive web pages, then extended to servers and mobile apps | Large enterprise applications, Android apps, server-side systems |
The one real thing they share is borrowed syntax: both use curly braces, semicolons, and many keywords that look alike. Learning Java does not teach you JavaScript, and the other way around.
In 2009, Ryan Dahl created Node.js, a runtime for running JavaScript on a server, built on the V8 engine. Since then, one language can write both sides of a website: code in the browser handles the mouse click, code on the server takes the data sent up, asks the database, and sends the result back.
Node.js calls itself a runtime, not a framework. It runs in an event-driven way: instead of waiting for each task to finish before starting the next, it takes a request, registers what to do when the result arrives, and moves on to the next request. That fits the work of a web server, where most of the time goes to waiting for a database or a network. According to Node.js, HTTP is treated as a first-class citizen in this environment, because it was built to make network applications.
Thanks to Node.js, learning JavaScript does not stop at static pages. A signup form in the browser sends data with JavaScript, a Node.js server receives it and stores it in a database with what SQL is, then sends the result back for the browser to show. To see how the browser and the server talk to each other, read what an API is and how it works.
JavaScript was created in 1995 at Netscape, by Brendan Eich. Netscape needed a language that people who were not professional programmers could still use to add interaction to a web page. The first prototype, codenamed Mocha, was written by Eich in about ten days in May 1995, then refined for months before release. The language first appeared as LiveScript in a beta of the Navigator browser in September 1995, then took the name JavaScript for the official release in December 1995.
In November 1996, Netscape submitted JavaScript to Ecma International for standardization. The first standard, named ECMAScript, came out in June 1997. The name ECMAScript was a compromise between Netscape and Microsoft, which had built a similar version called JScript.
The ECMAScript standard still gets a new edition every year. A notable update was ES6, released in 2015, which added much of the syntax modern JavaScript code still uses. The 16th edition, ES2025, came out in June 2025. Newcomers do not need to remember all of this history, only that code written to the new standard still runs on older browsers through conversion tools, so it is safe to learn from the newest documentation.
| Wrong | Right |
|---|---|
| JavaScript is only for pretty effects on a web page | Effects are only one part. JavaScript checks forms before they are sent, calls APIs for fresh data, stores data in the browser, and runs on the server through Node.js |
| JavaScript is a cut-down version of Java | Two separate languages, different in design. The names are close for marketing reasons, from a time when Java was rising |
| You must learn all the syntax before you can build anything | Reading one short piece of code, changing one spot, and seeing the page change is already a start. Syntax is learned step by step, following the work at hand |
The third misunderstanding is worth one more line, because it holds many people back. JavaScript has a large amount of syntax, but the part you use every day is small: variables, functions, conditions, loops, and listening for events. Those five are enough to add interaction to a web page.
Yes. JavaScript is an open language, the ECMAScript standard is public, and every browser runs it without charging a fee. You need no license and no paid tool to start.
A few weeks with the syntax is enough to add interaction to a static page: a menu that opens, a form that reports errors, a button that changes content. Building a full application, with login and saved data, takes months more, plus learning servers and databases.
The content and appearance, handled by HTML and CSS, still show up, but the interactive parts stop: buttons do not respond, forms are not checked at once, and content that loads later never appears. Many pages show a warning when they detect JavaScript is off.
Yes. Many simple games run straight in the browser in JavaScript, drawn with canvas or WebGL. Large, graphics-heavy games still use dedicated engines.
JavaScript is the language that makes a web page respond to you, and the fastest way to understand it is to run it. Open the console, type the cart example, change one number, and watch the total follow.
Comments
You can use your Google account to comment. Google only shares your verified name and email address to display your name. You can log out at any time.
Sign in with GoogleNo comments yet. Be the first!