JavaScript Tutorial

Learn JavaScript, the programming language of the web, from variables and functions to the DOM, events and async code.

JavaScript (JS) is a lightweight, interpreted (JIT-compiled), dynamically typed language. It was created by Brendan Eich at Netscape in 1995, and is standardised as ECMAScript. It runs in every browser, and on servers through Node.js.

Your First Program

JavaScript
console.log("Hello, JavaScript!");
Hello, JavaScript!

Adding JavaScript to a Page

HTML
<!-- Internal -->
<script>
    console.log("Page loaded");
</script>

<!-- External (recommended) -->
<script src="app.js" defer></script>

Open the browser's developer console (F12 → Console) to see console.log output.

HTML, CSS and JavaScript

LanguageRole
HTMLStructure (the nouns)
CSSPresentation (the adjectives)
JavaScriptBehaviour (the verbs)
Track your progress through the JavaScript course