Home arrow JavaScript arrow Page 2 - Handling events with the DOM - Part III

Handling events with the DOM - Part III

In this third part of our series, we will learn about Event objects, the "type" property, how to determine the target of an event, and more.

Author Info:
By: Alejandro Gervasio
Rating: 4 stars4 stars4 stars4 stars4 stars / 14
May 03, 2005
  1. · Handling events with the DOM - Part III
  2. · Another creature in an object-based world: the Event object
  3. · Determining the type of event: the "type" property
  4. · Targeting objects: determining the target of the event
  5. · Focusing on keys: determining which key has been pressed
  6. · The x-y game: determining mouse coordinates
  7. · Buttons from the bottom: detecting mouse buttons

print this article

Handling events with the DOM - Part III - Another creature in an object-based world: the Event object
(Page 2 of 7 )


In the case of event handlers, the Event object of the DOM is the logical medium through we are able to manipulate user or system-generated events. Whether we’re clicking on a link or moving the mouse around, the object processes this information, making it available for further manipulation in Web documents.


The first browser incompatibility that we must face is the fact that IE doesn’t support the W3C Event Model. Instead of exposing an Event object to be passed to a handler function, it provides a global object named "window.event" that makes available some properties functionally similar to those present in the W3C Standard. On the other hand, Netscape and Mozilla do support the Event object pretty well.


Either we’re referencing the standards or proprietary models, but as soon as we need to read event data, we’re pretty overwhelmed with lots of properties, most of which don’t work in most popular browsers. There is such abundant information and specifications for each property and method implemented, that many Web developers end up getting confused about them, without putting their skills to use in practical and real-world situations. For this certainly valid reason, we’ll be focusing our attention on the most common event-related tasks that developers must face on a regular basis, in order to obtain fast and effective results.


Our first logical step consists of detecting the type of event generated. Let’s see how this can be done.


blog comments powered by Disqus

- Project Nashorn to Make Java, JavaScript Wor...
- JavaScript Virus Attacks Tumblr Blogs
- Google Releases Stable Dart Version, JavaScr...
- Khan Academy Unveils New JavaScript Learning...
- Accessing Nitro? There`s an App for That
- JQuery 2.0 Leaving Older IE Versions Behind
- Fastest JavaScript Engine Might Surprise You
- Microsoft Adjusting Chakra for IE 10
- Brendan Eich: We Don`t Need Google Native Cl...
- An Overview of JavaScript Statements
- An Overview of JavaScript Operators
- Overview of JavaScript Variables
- More of the Top jQuery Social Plugins
- The Top jQuery Social Plugins
- More of the Top jQuery Slider Plugins

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials