I need to find a way to change CSS: hover properties using JavaScript.
For example, suppose I have this HTML code:
<table> <tr> <td>Hover 1</td> <td>Hover 2</td> </tr> </table>
And the following CSS code:
table td:hover { background:#ff0000; }
I would like to use JavaScript to change the <td> hover properties, say, in the background: # 00ff00. know that I can access the background property of the background using JavaScript, like:
document.getElementsByTagName("td").style.background="#00ff00";
But I don't know the JavaScript equivalent for: hover. How to change these <td>: focus on JavaScript?
Your help is much appreciated!
javascript html css dhtml
Wagtail Jul 07 '12 at 1:27 2012-07-07 01:27
source share