JavaScript Tutorial
JS - Introduction JS - Basic JS - Placement JS - Output JS - Statements JS - Syntax JS - Variables JS - Comments JS - Data Types JS - Operators JS - Operator Precedence JS - Condition JS - Switch JS - Functions JS - Objects JS - Loops For JS - Loops While JS - Break JS - Strings JS - String Methods JS - Numbers JS - Number Methods JS - Arrays JS - Array Methods JS - Array Iteration JS - Events JS - Event Listener JS - Event Propagation JS - Date JS - Math JS - Random JS - Boolean JS - Type Conversion JS - RegExp JS - Exception JS - Scope JS - Debugging JS - Hoisting JS - Strict Mode JS - this Keyword JS - Mistakes JS - Best Practices JS - Performance JS - Form Validation JS - ES6 Features
JS Objects
Object Definitions Object Properties Object Methods Object Constructors Object Prototypes
JS Functions
Function Definitions Function Parameters Function Call Function Apply Function Closures
JS HTML DOM
DOM Introduction DOM Methods DOM Selectors DOM HTML DOM CSS DOM Attributes DOM Navigation
JS Browser BOM
JS - Window JS - Screen JS - Location JS - History JS - Navigator JS - Popup Alert JS - Timing JS - Cookies
JS AJAX
AJAX - Introduction AJAX - XMLHttp AJAX - Request AJAX - Response AJAX - PHP
JS JSON
JSON - Introduction JSON - Syntax JSON - Data Types JSON - Parse JSON - Stringify JSON - Objects JSON - Arrays JSON - PHP JSON - JSONP
JS References
JavaScript Reference JavaScript Methods HTML DOM Reference

JavaScript Introduction

JavaScript is the most popular and widely used client-side scripting language.

Client-side scripting refers to scripts that run within your web browser.

JavaScript is used to add interactivity and other dynamic features to web sites.

JavaScript is an object-oriented language, and it also has some similarities in syntax to Java programming language. But, JavaScript is not related to Java in any way.

This tutorial will help you learn the essentials of latest JavaScript, from the fundamentals to advanced topics.


Examples in each Chapter

Every chapter in this tutorial contains lots of practice examples that you can try and test yourself using our online editor to extend your learning. The purpose of these examples is to provide you a better understanding of the usage of JavaScript.

Basic JavaScript example
Run code

What JavaScript can do?

There are lot more things you can do with JavaScript:

  • JavaScript can modify the text content
  • JavaScript can change the style (CSS) and position of the Elements
  • JavaScript can change HTML Attributes
  • JavaScript can Hide and Show HTML Elements
  • JavaScript can Add and Remove HTML Elements
  • JavaScript can monitor events like mouse click, hover, etc and react to it
  • JavaScript can create alert pop-ups to display info or warning messages to the user
  • JavaScript can validate user inputs before submitting it to the server

The list does not end here, there are many other interesting things that you can do with JavaScript.


Why learn JavaScript?

JavaScript is one of the 3 languages all web developers must learn:

  1. HTML to define the content of web pages
  2. CSS to specify the layout of web pages
  3. JavaScript to add interactivity and other dynamic features

JavaScript is one of the most popular and in demand skills in today's job market for good reason. JavaScript not only enables you to add powerful interactions to websites, but is also the foundation of a lot of commonly used libraries (like jQuery) and frameworks (like AngularJS, ReactJS and NodeJS). As a web developer, it is essential that you have a solid understanding of this language.


Prerequisites

Before starting this module, you don't need any previous JavaScript knowledge, but you should have some familiarity with HTML and CSS. You are advised to work through the following modules before starting on JavaScript:

If you're a beginner, start with the basics and gradually move forward by learning a little bit every day.

We recommend reading this tutorial, in the sequence listed in the left menu.


JavaScript References

The reference section will give you the detailed information about all properties, methods, events, HTML DOM objects, browser objects, and more.

Go to JavaScript Reference