64x64 icon dark hosting
Choose a hosting plan here and get a free year's subscription to Tuts+ (worth $180).

JavaScript from Null: Chapter 5 – Events


Start a hosting plan from $3.92/mo and get a free year on Tuts+ (normally $180)

This post is part of a series called Javascript from Null.
JavaScript from Null: Chapter 4
JavaScript from Null: Cross-Browser Event Binding

As we move forward with JavaScript University, today, we'll learn how to add event handlers to elements on the page. Unfortunately, this can be more cumbersome than we'd hope, due to the fact that Internet Explorer must always be the black sheep. Nevertheless, we'll learn how to abstract these inconsistencies away to our custom utility function.

As with every JavaScript from Null screencast, it's not essential that you view the previous entries in the series before watching.

In this Screencast, you'll Learn About:

  • Working with .addEventListener
  • Working with IE's .attachEvent
  • Differences in the way browsers handle events.
  • Capturing phase vs. event bubbling
  • Building a utility function to abstract our cross-browser event handling.

Chapter 5: Events

Other Viewing Options

Ready to take your skills to the next level, and start profiting from your scripts and components? Check out our sister marketplace, CodeCanyon.