DOM Event Examples

Here we will show running some simple functions. The first will run automatically and add some elements to the next section.

Simple Click Type Event

We will set up a simple click hander on the following header

Click Me

Response follows:

Removing an Event Listener

We will set up a simple click hander on the following header. When the event is handled we will remove the listener, i.e., the event can only be activated once

Click Me

Response follows:

The Event Object

We'll set up the div below as a mouse down target.

Event Info: