Tutorials Tonight's Logo
Follow Us


What is Javascript?

Javascript is a programming language for giving web pages and web application functionality and behaviour. Its program is generally called a script. Javascript can control javascript tutorial elements, media, attributes and other contents on webpages or web applications. It is mostly used by browsers but many non browser environments also use javascript like Node.js, Apache CouchDB.

In browsers it is used to make web page dynamic, create a better user interface or to create some feature. It was originally developed by Netscape Communications.

Javascript is integrated with HTML so it's easy to use. It is a very important language when you are learning web development.

Why to learn javascript?

Without javascript your webpage will be static, unable to perform any task. Using javascript you can program your webpage how to behave on events. When you are learning web development then there are three main language that you must learn :

  1. HTML - It defines the content of a web page.
  2. CSS - It defines the layout and style of a web page.
  3. Javascript - It provides dynamic behaviour to the web pages.

  • First name of javascript was Mocha (codename) which was then changed to Livescript and finally changed to Javascript in the next three months.
  • Javascript is one most popular programming language.
  • Javascript was used by SpaceX in Dragon Flight.
  • Javascript was developed in just 10 days.

Advantages of Javascript

  • Simple : Javascript is simple and easy to learn and implement.
  • Speed: The Client-side Javascript is very fast as it runs immediately on the client-side browser.
  • Popularity: Javascript is very popular and is used everywhere. The Internet is full of javascript applications.
  • Frameworks: Javascript has a high number of frameworks. few of them are React, Angular, Vue etc.
  • Server-load: As Javascript performs various tasks on client-side so it reduces load on the server.

History of Javascript

In 1995 Netscape released javascript by Brendan Eich.

After the release of javascript it became very famous and Netscape chose ECMA (European Computer Manufacturers Association) to handle and maintain javascript.

Hello World With Javascript

Let’s see an example of a Hello World program using javascript. All the Syntax will be discussed in the next chapter.

console.log("Hello World!");
// or
alert("Hello World!");
▶ Run the code

Common use of javascript with example

1) Javascript can be used to pop an alert message on the webpage on certain actions.

<body onload="alert('The page is loaded')">
    Body Contents...
▶ Run the code

2) Javascript can change the content of an element.

  <p id="id1">Change this content.</p>
  <button onclick="myfunction()">click me</button>
    function myfunction() {
      document.getElementById("id1").innerHTML = "Welcome To TutorialsTonight.";
▶ Run the code

3) Javascript can change the look of an element.

  <p id="id1"> Click the button to change my color and font - size. </p>
  <button onclick="myfunction()"> click me </button>
    function myfunction() {
      document.getElementById("id1").style.color = "red";
      document.getElementById("id1").style.fontSize = "25px";
▶ Run the code

Javascript has way more usage that you will learn in further exercises.

More Learning

Want to learn more about programming and web development? We have a few recommendations for you.

Follow Us

Copyright © Tutorials Tonight. All Rights Are Reserved.