JavaScript Triggers
JavaScript Triggers describes how you can use custom attributes to attach JavaScript events to elements.
It’s a good article and an interesting concept, but like several of the people commenting the article over at A List Apart, I’m not sure it’s worth the trouble of creating a custom DTD to be able to use custom attributes.
- Previous post: Web Developer 0.9.3
- Next post: Information Aversion
Subscribe / follow
Sponsors
Authentic Jobs
- Talented Web Designers & PHP Developers - Let's Talk! at Advant Interactive (Venice, CA, Ca, US)
- UI Designer at charity: water (New York City, Ne, US)
- WordPress Developer at Maskar Design (Philadelphia, PA, Pe, US)
- Lead Java Developer at Synacor, Inc. (Buffalo, NY, Ne, US)
DreamHost web hosting
Use the promo code 456BEREASTREET3 to save USD 20 when you sign up for DreamHost


Comments
Like the original poster on alistapart mentioned. ClassNames are a great (though) lesser alternative to bolt event handlers on. I’ve been playing with these for quite a while too. It keeps the source code nice and strict with all the event handling done externaly.
Imaging having this in you code:
Instead of all this:
You might want a little look at my examples.
Woolly: yes, that is a lot cleaner, and I’ve been using similar methods myself lately. I don’t see myself going to the trouble of making a custom DTD though. Not at the moment, anyway.
Comments are disabled for this post (read why), but if you have spotted an error or have additional info that you think should be in this post, feel free to contact me.