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
- Follow us on Twitter, or subscribe to the Nettuts+ RSS Feed for the best web development tutorials on the web. Ready
Ready to take your skills to the next level, and start profiting from your scripts and components? Check out our sister marketplace, CodeCanyon.
Subscribe below and we’ll send you a weekly email summary of all new Code tutorials. Never miss out on learning about the next big thing.
Update me weeklyEnvato Tuts+ tutorials are translated into other languages by our community members—you can be involved too!
Translate this post