最简单的tab切换!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script language="javascript">
function showandhide(id) {
document.getElementById('p1').style.display='none';
document.getElementById('p2').style.display='none';
document.getElementById(id).style.display='block';
}
</script>
</head>
<body>
<h1>
<a onmouseover="showandhide('p1')" >鼠标放我上面</a>
<a onmouseover="showandhide('p2')">换到我这试试</a>
</h1>
<div id="p1">最简单的tab切换,复制代码测试一下。</div>
<div id="p2" style="display:none;"> 成功了。</div>
</body>
</html>

浙公网安备 33010602011771号