内嵌的html代码,本人初学者,这样处理的效果
<html>
<head>
<title>tab</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
function switchTab(ProTag, ProBox) {
for (i = 1; i < 5; i++) {
if ("tab" + i == ProTag) {
document.getElementById(ProTag).getElementsByTagName("a")[0].className = "on";
} else {
document.getElementById("tab" + i).getElementsByTagName("a")[0].className = "";
}
if ("con" + i == ProBox) {
document.getElementById(ProBox).style.display = "";
} else {
document.getElementById("con" + i).style.display = "none";
}
}
}
</script>
<style type="text/css">
{ padding: 0;
margin: 0;
line-height: 20px;
font-size: 12px;
list-style:none
}
#tabContainer
{
margin:30px;
}
#tabContainer li
{
float: left;
width: 55px;
margin: 10px;
background: #efefef;
text-align: center;
}
#tabContainer a
{
display: block;
backgroud: #FAF6DC;
text-decoration:none;
}
#tabContainer a.on
{
background: #C2D7A2;
text-decoration:none;
}
</style>
</head>
<body>
<div id="tabContainer">
<ul>
<li id="tab1"><a href="#" class="on" onclick="switchTab('tab1','con1');this.blur();return false;">
年累</a></li>
<li id="tab2"><a href="#" onclick="switchTab('tab2','con2');this.blur();return false;">
月累</a></li>
</ul>
<div style="clear: both">
</div>
<div id="con1">

<html>
<head>
<title>tab</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
function switchTab(ProTag, ProBox) {
for (i = 1; i < 5; i++) {
if ("tab" + i == ProTag) {
document.getElementById(ProTag).getElementsByTagName("a")[0].className = "on";
} else {
document.getElementById("tab" + i).getElementsByTagName("a")[0].className = "";
}
if ("con" + i == ProBox) {
document.getElementById(ProBox).style.display = "";
} else {
document.getElementById("con" + i).style.display = "none";
}
}
}
</script>
<style type="text/css">
{ padding: 0;
margin: 0;
line-height: 20px;
font-size: 12px;
list-style:none
}
#tabContainer
{
margin:30px;
}
#tabContainer li
{
float: left;
width: 55px;
margin: 10px;
background: #efefef;
text-align: center;
}
#tabContainer a
{
display: block;
backgroud: #FAF6DC;
text-decoration:none;
}
#tabContainer a.on
{
background: #C2D7A2;
text-decoration:none;
}
</style>
</head>
<body>
<div id="tabContainer">
<ul>
<li id="tab1"><a href="#" class="on" onclick="switchTab('tab1','con1');this.blur();return false;">
年累</a></li>
<li id="tab2"><a href="#" onclick="switchTab('tab2','con2');this.blur();return false;">
月累</a></li>
</ul>
<div style="clear: both">
</div>
<div id="con1">
