SOURCE

console 命令行工具 X clear

                    
>
console
<style>
  div{width:200px;height:200px;background:#CCC;display:none}
  input{background-color:#FFF;}
  .active{background:#FF0;} 
</style>
<title>无标题文档</title>
<script type="text/javascript">
window.onload=function ()
{
	var aBtn=document.getElementsByTagName('input');
	var aDiv=document.getElementsByTagName('div');
	var i=0;
	for(i=0;i<aBtn.length;i++)
	   {
		    aBtn[i].index=i;
		    aBtn[i].onclick=function ()
			{
				for(i=0;i<aBtn.length;i++)
		         {   
			         aBtn[i].className='';
					 aDiv[i].style.display='none';
		         }
				this.className='active';
				aDiv[this.index].style.display='block';
			};
	   }
};
</script>
</head>
<body>
<input type="button" class="active" value="1"/>
<input type="button" value="2"/>
<input type="button" value="3"/>
<div style="display:block">1111</div>
<div>2222</div>
<div>3333</div>
</body>