…it’s all about layers.
We should separate behavior and structure by discarding inline event handlers like onmouseover=”switchImages(‘fearful’,6,false)”. Instead, as with CSS, we should use triggers to tell the script where to deploy the behavior.
Great stuff. He advocates the use of your own custom attributes on elements to drive script behavior (eg >input type=”text” required=”true” inputtype=”phonenumber” <). This is one of my favorite tricks as well, but the major drawback is that your page will no longer validate, because there’s no such attribute as ‘required’ or ‘inputtype’ in the HTML spec.
A List Apart is a very low-volume site, but whenever they publish something, it’s always well worth the read.