JavaScript Tutorial
JavaScript is the programming language of the web. HTML builds the page, CSS makes it look good, and JavaScript makes it do things: react to clicks, check forms, show and hide content, and load new data without reloading the page.
Every modern browser can run JavaScript, so you do not need to install anything to start. You only need a browser and this tutorial.
Why Learn JavaScript?
- It runs on almost every website in the world
- It is the only language that runs directly inside the browser
- With Node.js it also runs on servers, so one language can build a full website
- Frameworks like React, Vue and Angular are all built on JavaScript
- It is one of the most requested skills in web development jobs and freelancing
Try it Yourself
Every complete example has a Try it Yourself button. Click it, change the code and press Run.
Example
<!DOCTYPE html>
<html>
<body>
<h2>My First JavaScript</h2>
<button onclick="document.getElementById('msg').innerHTML = 'Assalam o Alaikum, welcome to JavaScript!'">Click me</button>
<p id="msg"></p>
</body>
</html>Try it Yourself »What You Will Learn
- Where to write JavaScript and how to show output
- Variables, data types and operators
- Functions, objects, strings, numbers and arrays
- Conditions and loops to control your program
- Events and the HTML DOM, to change a page while it is open
- Promises, async/await, fetch and JSON
- Modern ES6+ features used in real projects
Exercises and Quiz
Most lessons end with a short exercise, and the last lesson is a quiz on the whole tutorial.
Exercise
Where does JavaScript run when you open a normal web page?
Before and After JavaScript
You should know a little HTML and CSS before you start. After this tutorial, learn TypeScript to write safer JavaScript, or jQuery to see a popular library built on it.
Want to learn with a teacher? The Workownix Web Development course covers HTML, CSS and JavaScript with real projects, online or at our institute in Orangi Town, Karachi.
