<div class="wrap2top"> <div class="nTab"> <div class="TabTitle"> <ul id="myTab1"> <li class="current" onclick="nTabs(this,0);">供应信息分类</li> <li class="wtittxt" onclick="nTabs(this,1);">需求信息分类</li> </ul> </div> <div class="TabContent"> <div id="myTab1_Content0"> aaaaa </div> <div id="myTab1_Content1" class="none"> ssssss </div> </div> </div> </div> <div class="wrap2down"> <div class="nTab"> <div class="TabTitle"> <ul id="myTab2"> <li class="current" onclick="nTabs(this,0);">供应信息</li> <li class="wtittxt" onclick="nTabs(this,1);">需求信息</li> </ul> </div> <div class="TabContent"> <div id="myTab2_Content0"> 111111111111 </div> <div id="myTab2_Content1" class="none"> 222222222222222 </div> </div> </div> </div>
<script type="text/javascript"> function nTabs(thisObj,Num){ if(thisObj.className == "current")return; var tabObj = thisObj.parentNode.id; var tabList = document.getElementById(tabObj).getElementsByTagName("li"); for(i=0; i <tabList.length; i++) { if (i == Num) { thisObj.className = "current"; document.getElementById(tabObj+"_Content"+i).style.display = "block"; }else{ tabList[i].className = "wtittxt"; document.getElementById(tabObj+"_Content"+i).style.display = "none"; } } }</script>