JavaScript Basic Tutorial

  • Previous Page CSS
  • Next Page XML

In millions of pages, JavaScript is used to improve design, validate forms, detect browsers, create cookies, and so on and so forth.

JavaScript is the most popular scripting language on the Internet and can run on all major browsers, such as Internet Explorer, Mozilla, Firefox, Netscape, and Opera.

The basic knowledge you should have:

Before you continue learning, you should have a basic understanding of the following knowledge:

  • HTML
  • XHTML

If you want to learn this content first, please Home page Access related tutorials.

What is JavaScript?

  • JavaScript is designed to add interactive behavior to HTML pages.
  • JavaScript is a scripting language (scripting languages are lightweight programming languages).
  • JavaScript is composed of a few lines of executable computer code.
  • JavaScript is usually embedded directly into HTML pages.
  • JavaScript is an interpreted language (which means that the code is not precompiled before execution).
  • Everyone can use JavaScript without purchasing a license.

Are Java and JavaScript the same?

Different!

Conceptually and in design, Java and JavaScript are two completely different languages.

Java (developed by Sun Microsystems) is a powerful language and also a more complex programming language, like its peers C and C++.

What can JavaScript do?

JavaScript provides a programming tool for HTML designers
HTML creators are often not programmers, but JavaScript is a script language that has an extremely simple syntax! Almost everyone has the ability to place short code snippets into their HTML pages.
JavaScript can place dynamic text into an HTML page
A JavaScript declaration like this can place a variable text into an HTML page: document.write("<h1>" + name + "</h1>")
JavaScript can respond to events
JavaScript can be set to execute only when an event occurs, such as when the page is loaded or when the user clicks on an HTML element.
JavaScript can read and write HTML elements
JavaScript can read and change the content of HTML elements.
JavaScript can be used to validate data
JavaScript can be used to validate these data before the data is submitted to the server.
JavaScript can be used to detect the visitor's browser
JavaScript can be used to detect the visitor's browser and load the corresponding page based on the detected browser.
JavaScript can be used to create cookies
JavaScript can be used to store and retrieve information located on the visitor's computer.
  • Previous Page CSS
  • Next Page XML