How to use JavaScript+CSS+DIV to change the color of the table

一个新手
Release: 2017-09-22 10:36:23
Original
1624 people have browsed it

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)
Copy after login

2. Implement the change of row color:

changeColor(row)
Copy after login

Implementation code:

   变色表格示例      
学校专业人数
北大法律2000
清华计算机5000
人大经济6000
Copy after login

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!

Related labels:
css
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!