Home > Article > Web Front-end > JavaScript implements automatic change of table border color_javascript skills
The code is as follows, you can also view the effect by saving it to an HTML file:
<html> <head> <meta charset="utf-8"> <title>表格边框变换颜色代码</title> </head> <body> <table border="0" width="261" id="change_jb51_net" style="border:1px solid red"> <tr> <td>等待,然后注意看边框是不是变色了?</td> </tr> </table> <script> <!-- function hovertreecolor(){ if (change_jb51_net.style.borderColor=="blue") change_jb51_net.style.borderColor="red" else change_jb51_net.style.borderColor="blue" } setInterval("hovertreecolor()", 3000) </script> </body> </html>
The above is the entire content of this article, I hope you all like it.