a标签点击改变颜色,同时table里面内容颜色改变

<script type="text/javascript">
  	function changeColor(table, color, background, wordcolor){
		var t=document.getElementById(table).getElementsByTagName("td");
		for(var i=0;i<t.length;i++){
			t[i].style.backgroundColor=color;
			t[i].οnmοuseοver=function(){
				if(this.x!="1") {
					this.style.backgroundColor=background;
					this.style.color= wordcolor;
				}
			}
			t[i].οnmοuseοut=function(){
				if(this.x!="1") {
					this.style.backgroundColor=color;
					this.style.color= "#000000";
				}
			}
		}
  	}
  </script>
  <style type="text/css">
  	body{width:100%; font:13px "宋体", Arial, Helvetica, sans-serif; color:#333;}
  	.areaList{
		border:1px #000 solid;
		border-left:none;
		border-bottom:none;
	}
	.areaList td{
		border-left:1px #000 solid;
		border-bottom:1px #000 solid;
		height:35px;
		text-align:center;
	}
	a {text-decoration: none;color: #000000;}
	a:HOVER {color: #A91709;}
  </style>

 

<div style="background-color:#FFFFFF;">
<h2><center>省级骨干横向</center></h2>
    <div>
      <table class="areaList" id="areaList" border="0" cellspacing="0" cellpadding="0" width="800px" align="center">
		<tbody>
			<td>地址</td>
			<td>名称</td>
		</tbody>
		<tr>
			<td>172.168.0.1</td>
			<td><a href="performanceMonitor.do?action=more" target="_blank" target="_blank">路由器</a></td>
		</tr>
</table>
    </div>
</div>
<script type="text/javascript">
  	 changeColor("areaList", "#FFF", "#9CCFFF", "#A91709");
  </script>
 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值