如下所示;
复制代码代码如下::
<! DocType html public "-// w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transsitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<kopf>
<meta http-äquiv = "content-type" content = "text /html; charset = utf-8" />
<title> 无标题文档 </title>
<script type = "text/javaScript">
Funktion Change_bg (OBJ)
{
var a = document.getElementById ("Menü"). getElementsByTagName ("a");
für (var i = 0; i <a.länge; i ++)
{
a [i] .className = "";
}
obj.className = "current";
}
</script>
<style type = "text/css">
Körper{
Schriftgröße: 17px;
}
.aktuell{
Hintergrund: Rot;
}
#Container ul
{
Typ-Typ-Typ: Keine;
}
#Container ul li
{
float: links;
Rand-Rechts: 3px;
}
#Container ul li a {
Textdekoration: Keine;
Farbe:#000;
}
</style>
</head>
<body>
<div id = "Container">
<ul id = "Menü">
<li> <a href = "JavaScript:" Onclick = "Change_bg (this)"> Menü1 </a> </li>
<li> <a href = "JavaScript:" Onclick = "Change_bg (this)"> Menü2 </a> </li>
<li> <a href = "JavaScript:" Onclick = "Change_bg (this)"> Menü3 </a> </li>
<li> <a href = "javaScript:" onclick = "change_bg (this)"> Menü4 </a> </li>
<li> <a href = "JavaScript:" Onclick = "Change_bg (this)"> Menü5 </a> </li>
</ul>
</div>
</body>
</html>