我如何在按钮中使用主动选择器. [英] how i use active selector in button.
本文介绍了我如何在按钮中使用主动选择器.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在按钮中使用活动选择器?
当我单击该按钮时,我想激活一种颜色.我正在使用hover属性来更改颜色,但我想一直保持这种颜色,直到单击另一个控件为止,反之亦然.
How I use active selector in button?
I want to active a color when I clicked in that button. I am using hover property for changing color but I want to sustain that color until I clicked in another control vice versa.
推荐答案
创建一个函数,该函数将调用onfocus事件全部按钮-
Create a function which will call onfocus event of all button--
function SetColoring(btn)
{
btn.style.backgroundColor=color1;
// put all other buttons in other color;
}
--Pankaj
--Pankaj
这篇关于我如何在按钮中使用主动选择器.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文