本文实例为大家分享了JS编写简单选项卡的具体代码,供大家参考,具体内容如下
rush:xhtml;">
<Meta charset="UTF-8">
jquery选项卡
<script type="text/javascript">
window.onload=function(){
var oDiv=document.getElementById('div1');
var aInput=document.getElementsByTagName('input');
var aCon=oDiv.getElementsByTagName('div');
for (var i = 0; i < aInput.length; i++) {
aInput[i].index=i;
aInput[i].onclick=function(){
for (var i = 0; i < aInput.length; i++) {
aInput[i].className='';
aCon[i].style.<a href="https://www.jb51.cc/tag/dis/" target="_blank" class="keywords">dis</a>play='';
}
this.className='active';
aCon[this.index].style.<a href="https://www.jb51.cc/tag/dis/" target="_blank" class="keywords">dis</a>play='block';
}
}
}
display: block;">11111
22222
33333