比如有三种颜色。点一次变一种。点倒第4次时返回默认色。要的是按钮背景变色
解决方案 »
- 求助,SQL,主题查看权限问题,双倍分数
- 谁给菜鸟解释下DAL,BLL,Model,DBUtility是什么意思?
- DIV浮动显示???
- vs 2005 开发好了怎么发布呀!!!
- 请教:关于DataGrid的显示问题,HELP……
- asp.net中怎样实现sql数据库备份?
- 高手请进,200分问一个客户端实现选择列变色的问题,在线等!
- ext.net CalendarPanel 急!!!
- 如何在CS文件里写代码添加dropdownlist控件?
- 变量附值与错误,大家帮忙看一下!谢谢!
- 各位!帮忙找找问题!找到的问题不重复就有分,分不够可以再加..急>>>>>>>>>>>>>>>
- asp.net网页以窗口形式弹出的问题
ie8,chrome下都没问题了,firefox下有问题,但是一时着急,搞不来,有空我再研究研究,参考下吧,问题范围已经缩小不不了
function aa()
{
document.getElementById("a").style.backgroundColor="#FF0000"}
</script>
<span id="a" style="height:20px;width:100px;background-color:#999;" onclick="javascript:aa();">test1</span>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Change btn Color</title>
<script language="javascript">
var colors=new Array();
colors[0]="";
colors[1]="#220099";
colors[2]="#ff2233";
colors[3]="#114455";
window.onload=function(){
var btn_change=document.getElementById('change');
var currIndex=0;
//btn_change.style.backgroundColor=colors[currIndex];
btn_change.onclick=function(){
currIndex=(currIndex+1)%4;
//alert(currIndex);
btn_change.style.backgroundColor=colors[currIndex];
}
}
</script>
</head><body>
<input type="button" value="ChangeColor" id="change">
</body>
</html>IE6 FF 下测试过,没问题!其他浏览器没有!