DOM Events and JavaScript

The purpose of this assignment was to learn how to use JavaScript with the DOM, and about some of the event types available through the DOM's window and document objects.

The description and my solution of the DOM Events -assignment can be viewed at the bottom of this page.

What is DOM

See the DOM section in previous assignment: About DOM

What is the DOM Window Object?

See the window object section in previous assignment: About the window object

What are DOM Events?

Events are captured by event handlers. The event handler trigger the code specified to execute.

Event handlers handels events on diffrent DOM objects, and are represented by an attributes. The onload attribute represents the the onload handler, and the onload handler handels load events on the window object.

Event handler attributes prepend the letters "on" to the event name; thus an event handler attribute for a load event is written as onload.

In window.onload, for example, the load event of the window object is captured by the event handler thru it's onload attribute. The onload attribute then represents the the event handler for a load event on the window object.

You can assign code to be executed when the event handler is triggerd. A simple example would be the predefined window.alert() method to execute it's code when the onload event handler is triggered by a load event.

Assignment Description

Create a page that make use of the load, unload, resize event types of the window object, and the click event type of the document object.
An annoying popup should display information about event type.

My solution, Assignment Files

«  Previous Next  »