Category Archives: JavaScript

Introduction to JavaScript

Before learning JavaScript you should have basic knowledge of HTML and CSS, be able to use a HTML editor such as Notepad and
an Internet browser such as Mozilla Firefox.

JavaScript and Java are two different languages. Java is a full programming language, more powerful (but more complex) and it
must be compiled before a program can be executed. JavaScript is a scripting language which doesn’t need a compiler, it is simpler,
and more indulgent in some areas, such as syntax.

Continue reading

JavaScript variables

Table of content:

What is a variable?

A variable represents or hold a value.

Let’s consider the very commonly use example x=2. The name of the variable would be x and its value would be 2. The value of a variable can be changed at any given time simply by giving x a new assignment. For example x=4.

Consider the following math problem:
If x=2, then 3+x=?

Continue reading

JavaScript functions

Table of content:

What is a function in JavaScript?

A function is a piece of script within another larger script. A function is use to perform one or multiple tasks according to what code is placed inside it.

Functions can be use to organize a script into parts that accomplish different things. Functions can be reused as many times as you wish by simply calling the function again.

Continue reading

JavaScript operators

Table of content:

What are JavaScript operators

A JavaScript operator is a symbol or a word that performs a calculation, comparison, or assignment on one or more values. JavaScript operators do much of the work in script. There are many types of JavaScript operators.

Continue reading

JavaScript Loops

Table of content:

What is a loop in JavaScript

A loop in JavaScript allows you repeat a section of code a certain number of times which is useful if you want to shorten your code or change some of the variable values for example. By using loops you also avoid typing errors in the repeating lines of code.

Continue reading

JavaScript Event Handlers

Table of content:

What is an event handler

An event handler is a predefined JavaScript property of an object that is used to handle an event on a web page. When a viewer of a web page performs an action such as clicking a button, moving the mouse over a particular part of the web page etc means that an event is taking place. JavaScript can identify these events and react to them making the web page more interactive and useful.

Continue reading

Objects in JavaScript

Table of content:

Continue reading

The Document Object in JavaScript

Table of content:

Continue reading

The Window Object in JavaScript

Table of content:

Continue reading