Triggering Behavior in Web Pages
February 1st, 2005I just read a great article entitled JavaScript Triggers and it covers techniques to keep CSS style separate from Javascript behavior. It provides a few options and explains their use. It ends up showing how you can invent your own attributes and add them to any element you like. This would normally cause XHTML validators to point out errors, but you can extend the DTD as explained in Validating a Custom DTD. I have been experimenting quite a bit with the these techniques which work well in Internet Explorer 5.5 and 6 as well as modern Mozilla versions like Firefox. And you can also use these "advanced" features in Safari on the Mac. There is excellent documentation available to explain how it can be done.
