js implements a method of changing color over a table row with the mouse

  • 2020-06-12 08:27:25
  • OfStack

An example of js shows how to change the color of a table row with the mouse. Share to everybody for everybody reference. Specific implementation methods are as follows:

<script type=text/javascript>
 var rows = document.getElementById("listdata");
 var add = function(){
 var del = function(){
 for(var m=rows.firstChild;m!=null;m=m.nextSibling){
 m.onmouseover = add;
 m.onmouseout = del;

Hopefully, this article has been helpful in your javascript programming.

Related articles: