<!DOCTYPE html>
<html>
<head>
<title>tabCase</title>
</head>
<script type="text/javascript">
window.onload=function()
{
var oDiv=document.getElementById('div1');
var aBtn=oDiv.getElementsByTagName('input');
var aDiv=oDiv.getElementsByTagName('div');
for (var i = 0; i < aBtn.length; i++)
{
aBtn[i].index=i;
aBtn[i].onmouseover=function()
{
for (var j = 0; j < aBtn.length; j++)
{
aDiv[j].style.display='none';
aBtn[j].className='';
}
this.className='hve';
aDiv[this.index].style.display='block';
};
}
};
</script>
<style type="text/css">
.content{
width: 300px;
height: 300px;
background: #eee;
display: none;
}
.hve{
border: none;
background-color: #eee;
}
</style>
<body>
<div id="div1">
<input type="button" value="tab1" class="hve">
<input type="button" value="tab2">
<input type="button" value="tab3">
<input type="button" value="tab4">
<div class="content" style="display:block">1111</div>
<div class="content">2222</div>
<div class="content">3333</div>
<div class="content">4444</div>
</div>
</body>
</html>
tabCase
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。