If I could show you how to extend the pseudo class hover in IE to work on all elements, would you be interested?

That question drew a lot of response. This section is one of the most popular. It is right up there with Regular Expressions. So I decided to revisit the topic.

IE 7 now supports :hover on all HTML element

The following pages provide two simple techniques to add hover effects for IE. These techniques use CSS attributes to bind JavaScript (JScript in IE) event handlers. There is no compliant way to get the hover effect in IE 6 and 5.x without scripting in some form.

The examples now use conditional comments (see Journal entry on conditional comments) to separate IE code. Originally, the code depended on browsers ignoring IE's proprietary features. Using conditional comments separates IE 6 from IE7 and pages more easily validate.

These techniques are not restricted to hover. They can be used to bind event handlers to any event supported by an HTML element. They can also be used to bind JavaScript formulas to CSS attributes (see CSS Right Justify, Handling IE for an example).