Set up a table. When the mouse moves to a certain row, the color changes. When the mouse leaves, the color changes to the original color. Each line requires two mouse events:
1. Mouse override: onMouseOver
2. Mouse out: onMouseOut
At the same time, these two events need to call the event function:
1. To set the color of the row:
resetColor(row)
2. Implement the change of row color:
changeColor(row)
Implementation code:
The above is the detailed content of How to use JavaScript+CSS+DIV to change the color of the table. For more information, please follow other related articles on the PHP Chinese website!