Javascript Introduction

Javascript is programming language that makes HTML web pages interactive.

    Importance of javascript:

  • Javascript can chage the HTML content.
  • Javascript can make HTML pages interactive.
  • Javascript tells the browser what to do when certain item is selected.
  • Almost all the modern websites use javascript.


Changing HTML documents using javascript

<!DOCTYPE html>
<p id="javascript">This is example of javascript.</p>
<button type="button" onclick="document.getElement
innerHTML='This text
will appear after clicking button.'">


This is example of javascript.

Advantages of javascript

  • Less load in server-In javascript user input can be validated immediately after data is enetered due to which less load is given n server.
  • Immediate response-Javascript automatically validates form inputs and suggests users what type of data is to be enetered.
  • Interaction--Special effects like drag and drop can be added much more efficiently using javascript.