如果先前已选择如何将其他Gridrow的颜色更改为默认颜色

如果先前已选择如何将其他Gridrow的颜色更改为默认颜色

本文介绍了如果先前已选择如何将其他Gridrow的颜色更改为默认颜色,以及如何将当前Gridrow的颜色更改为黄色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

function ChangeRowColor(rowID)
        {

            var color = document.getElementById(rowID).style.backgroundColor;

              if (color == 'yellow')
                  document.getElementById(rowID).style.backgroundColor="white";
              else
                  document.getElementById(rowID).style.backgroundColor ="yellow";
            }




例如:考虑到一旦选择了第一行,我就有两个网格行,则颜色必须更改为黄色,如果我选择了第二个网格行,则它应更改为黄色,并且第一行必须更改为其默认颜色...
请帮助...




ex: consider i have two gridrows once the 1st row is selected the color has to change to yellow and if i select the 2nd gridrow then it should change to yellow and the 1st row must be changed to its default color...
please help...

推荐答案


这篇关于如果先前已选择如何将其他Gridrow的颜色更改为默认颜色,以及如何将当前Gridrow的颜色更改为黄色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 07:13