Thursday, 12 June 2014

JavaScript - An Object Based Scripting Language

JavaScript is an object - based scripting language that is mainly used for making the web pages more interactive. This programming language has been devised for HTML (Hyper Text Markup Language), web, computers, tablets, etc. JavaScript was first utilized and implemented by Netscape Communications Corporation in Netscape Navigator 2 beta in the year 1995.


 What is Scripting Language?


A scripting language is a type of programming language. These codes or instructions are prepared and used for specific run - time environments.

Features of JavaScript: -

Today JavaScript is mostly supported by all the browsers. Some of the salient features of JavaScript are written below: -

  •  It has the capability to modify DOM. DOM is an acronym for Document Object model. It is the official W3C standard that allows the access to HTML elements.
  • JavaScript can make changes in the HTML elements.
  • JavaScript can clone i.e. create duplicate copies of HTML elements.
  • It can be used in creating various interactive drop - down menus.
  • JavaScript can also be used for providing various hover effects.
  • All major web browsers such as Internet Explorer, Firefox, etc. support JavaScript.
  • JavaScript can also be used for validating data.
Sample Code that shows how JavaScript changes the HTML elements: -

As already mentioned, JavaScript has the capability to modify DOM, the below code shows how the HTML elements can be modified using DOM: -

document.getElementById("demo").innerHTML = "Hello JavaScript";

NOTE: - JavaScript is always misunderstood as Java. Both of these languages are absolutely different. On one hand, Java is a programming language and a platform, on the other hand, JavaScript is a scripting language. 

No comments:

Post a Comment