Jeremy Keith argues CSS 2 pseudo-classes which enhance pages (:hover, :focus, etc.) are behaviors, and such effects ought to be implemented by scripting the Document Object Model.
This started with Derek Featherstone asking designers and developers to stop treating IE6 as a pariah because of its incomplete CSS 2 implementation.
Keith says:
I think this belief isn’t based on the reality of developing with the DOM. Rather, it’s part of the FUD surrounding JavaScript in general. It is still considered by many to be a nasty, inaccessible technology.
Mark Wubben responded with a simple script implementing :hover that runs as an onload event.
The idea here is that you can build these effects in a standards-compliant manner with the JavaScript DOM implementation in the browser.
Unfortunately, I have to use the DOM for things that aren’t behaviors. To display the cite attribute of a blockquote, I use a script based on Simon Willison’s work that copies the link into a new element and adds it to the DOM after the page loads.
And the DOM still has issues. Peter Paul Koch tested the DOM methods versus the InnerHTML methods introduced by IE (but supported everywhere) and found the non-standard InnerHTML methods are faster.
The takeaway: scripting will get you around some IE issues, but:
- You have to use JavaScript to reveal information that should be addressable
- Non-standard methods for modifying the DOM run faster than the standards.
I wouldn’t couch using these techniques as ’standards-compliant’ alternatives to CSS, but they are good compromises.