Avascript tab TAB [compatible Ie6,ie7,ie8,fox browser]
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title>javascript tab TAB [compatible Ie6,ie7,ie8,fox browser]</title>
<script type= "Text/javascript" >
function Ntabs (thisobj,num) {
if (Thisobj.classname = = "active") 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 = "active";
document.getElementById (tabobj+ "_content" +i). Style.display = "block";
}else{
Tablist[i].classname = "normal";
document.getElementById (tabobj+ "_content" +i). Style.display = "None";
}
}
}
</script>
<style type= "Text/css" >
#myTab02 Li, #myTab li{
Float:left;
Display:block;
width:50px;
border:1px solid #666666;
}
#ac, #ac1 {
width:150px;
height:50px;
Clear:both;
}
body,td,th {
font-size:12px;
}
</style>
<body>
<ul id= "MYTAB02" >
<li class= "Active" onclick= "Ntabs (this,0);" > New House </li>
<li class= "Normal" onclick= "Ntabs (this,1);" > Second-hand Housing </li>
<li class= "Normal" onclick= "Ntabs (this,2);" > Rental </li>
<li class= "Normal" onclick= "Ntabs (this,3);" > Rental </li>
</ul>
<div style= "Clear:both" ></div>
<div id= "AC" >
<div id= "Mytab02_content0" >
Aaaa
</div>
<div id= "Mytab02_content1" style= "Display:none;" >
Bbb
</div>
<div id= "Mytab02_content2" style= "Display:none;" >
Ccc
</div>
<div id= "Mytab02_content3" style= "Display:none;" >
dddd
</div>
</div>
<div style= "Clear:both" ></div>
<ul id= "Mytab" >
<li class= "Active" onclick= "Ntabs (this,0);" > New House </li>
<li class= "Normal" onclick= "Ntabs (this,1);" > Second-hand Housing </li>
<li class= "Normal" onclick= "Ntabs (this,2);" > Rental </li>
<li class= "Normal" onclick= "Ntabs (this,3);" > Rental </li>
</ul>
<div style= "Clear:both" ></div>
<div id= "AC1" >
<div id= "Mytab_content0" >
Aaaa
</div>
<div id= "Mytab_content1" style= "Display:none;" >
Bbb
</div>
<div id= "Mytab_content2" style= "Display:none;" >
Ccc
</div>
<div id= "Mytab_content3" style= "Display:none;" >
dddd
</div>
</div>
</body>