what happens when you do it with an id then? you said it didnt work but didnt specify...
either way, try it using JQuery, JQuery always ends up fixing my thoughts on this... and actually to be more specific: JQuery-UI...
the example id prolly end up using is as follows:
Code:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>highlight demo</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css">
<style>
#toggle {
width: 100px;
height: 100px;
background: #ccc;
}
</style>
<script src="http://code.jquery.com/jquery-1.9.0.js"></script>
<script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
</head>
<body>
<p>Click anywhere to toggle the box.</p>
<div id="toggle"></div>
<script>
$( document ).click(function() {
$( "#toggle" ).toggle( "highlight" );
});
</script>
</body>
</html>
this was found here:
http://api.jqueryui.com/highlight-effect/
instead of changing its transparency, change its color, just a thought..