Described here is a technique to highlight html elements. We begin with some examples:

Mouse over on the <span> elements below and see the background-color changing:

Mouse over Mouse overMouse overMouse overMouse over

Mouse over on the <div> elements below and see the background-color changing:

Mouse over

Mouse over

Mouse over

Mouse over

Mouse over

There's an easy way to highlight many html elements, that is by using hover pseudo class. But hover pseudo class has limited browser support and it does not work on some d of elements. For example, it does not work on table-rows on Internet Explorer (as of version 7), but it does work on table-rows on Firefox 2. . Here are some examples of hover style applied to links (<a> elements) and <div>:

The blue section shows where the background-color is being changed (not that unlike style definitions which use background-color, you access the stye array by combining the property name and capitalizing the first letter of all the worlds except the first, so background-color becomes backgroundColor

For Step 4 (restoring the original background-color), we need to save the original background-color. This part of the code is marked in red. The other portion of the code pertaining to the firingElement is coded to retrieve the element which fired the event. You can see some browser-specific code there because Mozilla and Internet Explorer has different ways to access this object.