JavaScript Introduction

Jakob Jenkov
Last update: 2014-06-15

JavaScript makes it possible to make your HTML document dynamic, meaning you can change the HTML document while it is being displayed in the browser.

JavaScript is a programming language. You embed JavaScript code inside your HTML using the script element, like this;

<script>
    alert("This is a JavaScript code snippet");
</script>    

This little example shows a JavaScript alert box with the text This is a JavaScript code snippet.

The JavaScript code is executed when the browser encounters it in the browser. That may actually be before the full HTML document is loaded.

You can do a lot with JavaScript. For instance, you can:

  • Listen for events on form elements.
  • Listen for events on HTML elements in general (on mouse over, mouse out, click etc.)
  • Execute scripts at timed intervals.
  • Change the HTML document.
  • Change the CSS styles used by HTML elements.
  • ... and much, much more...

JavaScript is a big topic to cover, so this tutorial will not get into more detail about JavaScript. The internet is full of JavaScript tutorials, so a quick search on the web will reveal a lot of resources that can help you learn JavaScript.

Jakob Jenkov

Featured Videos

Java Generics

Java ForkJoinPool

P2P Networks Introduction



















Close TOC
All Tutorial Trails
All Trails
Table of contents (TOC) for this tutorial trail
Trail TOC
Table of contents (TOC) for this tutorial
Page TOC
Previous tutorial in this tutorial trail
Previous
Next tutorial in this tutorial trail
Next