JavaScript is a language that animates and adds action to a website. Where HTML contains or displays, where CSS describes or illustrates, where PHP contains or displays and instructs, JS acts.

Why is JavaScript good?

JavaScript can make your website interactive. JavaScript is behind buttons that do more than just take you to a new page. If you click something on a website (besides a link), and something changes or something happens - generally without loading a new page - chances are JavaScript is involved.

Example of JavaScript

A piece of Javascript might do something like this:

On the event of you clicking the "Send" button, the JavaScript will take the information you have entered into the form and send it to the email address specified within the JavaScript.

Or if there is something on the page you can click to expose hidden words or images, this is done with JavaScript.

JavaScript can also act in the background without the user doing anything. An example of JavaScript used this way would be the way website traffic statistics are collected using a piece of Java code from Google Analytics or StatCounter.