This is the table to be manipulated: <table id= "TB" > <tr><td> This is the first line </td> </tr> <tr><td> This is the second line </td > </tr> <tr><td> This is the third line </td></tr> <tr><td> This is line fourth </td></tr> </table>//This is the Operation form code <script> var rowno=-1; var tableId = ' TB '; var inputID = ' show '; var selectedcolor = "#FF0000" function Document.onkeydown () {//Event identification code if (Event.keycode = =) {for (Var k=0;k< document.getElementById (tableId). rows.length;k++) {document.getElementById (tableId). Rows (k). bgcolor= "#FFFFFF"; } if (Rowno = = 0) {rowno++; } document.getElementById (TableId). Rows (--rowno%document.getelementbyid (tableId). rows.length). bgcolor= Selectedcolor; document.getElementById (inputID). Value=document.getelementbyid (TableId). Rows (Rowno%document.getelementbyid ( tableId). rows.length). innertext; }//Event identification code if (event.keycode==) {for (Var K=0;k<document.getelementbyid (tableId). rows.length;k++) {document. GetelemenTbyid (tableId). Rows (k). bgcolor= "#FFFFFF"; } document.getElementById (TableId). Rows (++rowno%document.getelementbyid (tableId). rows.length). bgcolor= Selectedcolor; document.getElementById (inputID). Value=document.getelementbyid (TableId). Rows (Rowno%document.getelementbyid ( tableId). rows.length). innertext; } </script> <input type= ' text ' id= ' show ' value= ' do ' >
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]