This article mainly introduces how to change the color of a javascript table and how to move the mouse in and out, and how to click it. It involves some techniques related to how to change the color of the line and click the mouse in javascript, which is of great practical value, for more information about how to change the color of a javascript table, move the cursor, and click it. Share it with you for your reference. The specific analysis is as follows:
Table line-by-line discoloration is also a js effect to improve user experience.
Effect implementation:
The color of the table's parity rows is different. This prevents users from reading data in serial mode.
The color changes when the mouse moves into a row. This allows users to clearly know which row they are reading.
Click to change the color of the table. This allows you to select the items you want to retain.
Note:
I % 2: The modulo value of each number and 2 is only 0 and 1, so that the color of the line can be changed.
Tables_li [I]. onoff = 1; To achieve click color change, the color is not overwritten when the mouse moves in and out.
Code:
Untitled documentScript window. onload = function () {var tables = document. getElementById ("tables"); var tables_li = tables. getElementsByTagName ("tr"); var I = 0; var len = tables_li.length; for (I = 0; I
1 Content 2 Content 3 Content 4 Content 5 Content 6 Content 7 Content 8 Content 9 Content 10 Content
I hope this article will help you design javascript programs.