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






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.
Sorry, comments are closed for this post.