Events

When you browse the web, your browser registers different types of events. Examples of events are when the page loads, when you click a button, when you press a key etc. Your script can then respond to these events. Scripts often respond to these events by updating the content of the web page which makes the page feel more interactive.

Let's look at the following example:

JavaScript:
tutorial

HTML:
tutorial

In this example, user clicks the button on page and the browser pops up an alert window with a message. Events of clicking the button is recorded, handled and reacted by the pop up.

NEXT LESSON