标签:isp back tle cli title javascrip func get acl
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>无标题文档</title>
<style>
#div1 .aclick{background:red;}
#div1 div{width:200px;height:200px;background:#ccc;display:none;}
#div2 .aclick{background:red;}
#div2 div{width:200px;height:200px;background:#ccc;display:none;}
</style>
</head>
<body>
<div id="div1">
<input class="aclick" type="button" value="1111">
<input type="button" value="2222">
<input type="button" value="3333">
<input type="button" value="4444">
<div style="display:block;">111111111111</div>
<div>222222222222</div>
<div>33333333333</div>
<div>44444444444</div>
</div>
<div id="div2">
<input class="aclick" type="button" value="1111">
<input type="button" value="2222">
<input type="button" value="3333">
<input type="button" value="4444">
<div style="display:block;">111111111111</div>
<div>222222222222</div>
<div>33333333333</div>
<div>44444444444</div>
</div>
<script>
function tabCla(id){
var oDiv=document.getElementById(id);
var aBut=oDiv.getElementsByTagName(‘input‘);
var aDiv=oDiv.getElementsByTagName(‘div‘);
for(var i=0;i<aBut.length;i++){
aBut[i].index=i;
aBut[i].onclick=function(){
for(var i=0;i<aBut.length;i++){
aBut[i].className=‘‘;
aDiv[i].style.display=‘‘;
}
this.className=‘aclick‘;
aDiv[this.index].style.display=‘block‘;
}
}
}
tabCla("div1");
tabCla("div2");
</script>
</body>
</html>
标签:isp back tle cli title javascrip func get acl
原文地址:http://www.cnblogs.com/weiluguo/p/7389167.html