Functions Provided by Java Script

  1. Java Script can put dynamic text into an HTML page- using HTML, you can produce only static pages but javascript add dynamic functionality in HTML. A javascript statement like this: document.write("<h1>"+name+"</h1>") can write a variable text into an HTML page.
  2. JavaScript gives HTML designers a programming tool - HTML authors are normally not programmers, but javascript is a scripting language with a very simple syntax. Almost anyone can put small "snippets" of code into their HTML page.
  3. JavaScript can be used to Validate data -  A JavaScript can be used to validate form data before it is submitted to a server. This saves the server from extra processing.
  4. JavaScript can react to events -  Java script provide the concepts of events handling. A JavaScript can be set to execute when something happens like when a page has finished loading or when a user clicks on an HTML element. Eg button.
  5. Java Script can read and write HTML elements- A JavaScript can read and change the content of an HTML element.
  6. Java Script can be used to detect the visitor's browser - A Java Script can be used to detect the visitor's browser, and - depending on the browser-load another page specifically designed for the browser.
  7. Java Script can be used to create cookies - A Java Script can be used to store and retrieve information on a visitor's computer. 


Post a Comment