JavaScript is a object-oriented, scripting language, dialect of the standardized programming language ECMAScript, mainly used for scripting web-pages.

Javascript was originally named "Live Script" by Netscape and supported only by the Netscape browser.

JavaScript uses syntax influenced from that of the C family of languages. JavaScript follows many names and naming conventions from the Java programming language, but the two languages are otherwise not related and have very different semantics.

Background Color Change with JavaScript

Click Blue
Click Red
Click Green
Click Black
Click White


This is the JavaScript code that is used to change colors:

<script language="JavaScript">
function changeBGC(color){
document.bgColor = color;

<a href="#" onClick="javascript:changeBGC ('#000099')">Click Blue</a>

<a href="#" onClick="javascript:changeBGC ('#990000')">Click Red</a>

<a href="#" onClick="javascript:changeBGC ('#009900')">Click Green</a>

<a href="#" onClick="javascript:changeBGC ('#000000')">Click Black</a>

<a href="#" onClick="javascript:changeBGC ('#ffffff')">Click White</a>

Who on earth would NOT have Javascript running in their browser? Well..

There are legitimate reasons to switch it off

  • Some companies strip JavaScript at the Firewall
  • Some people run the NoScript Firefox extension to protect themselves from common XSS vulnerabilities
  • Some mobile devices ignore JS entirely