如下所示;
复制代码代码如下:
<! 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">
<adal>
<meta http-equiv = "contenu-type" contenu = "text / html; charset = utf-8" />
<Title> 无标题文档 </TITAL>
<script type = "text / javascript">
Fonction Change_BG (OBJ)
{
var a = document.getElementById ("menu"). GetElementsByTagName ("A");
pour (var i = 0; i <a.length; i ++)
{
a [i] .classname = "";
}
obj.className = "Current";
}
</cript>
<style type = "text / css">
corps{
taille de police: 17px;
}
.actuel{
Contexte: rouge;
}
#Container UL
{
Type de style liste: aucun;
}
#Container ul li
{
flottant: à gauche;
marge-droite: 3px;
}
#Container ul li a {
Décoration du texte: aucune;
Couleur: # 000;
}
</ style>
</ head>
<body>
<div id = "conteneur">
<ul id = "menu">
<li> <a href = "javascript:" onclick = "Change_bg (this)"> menu1 </a> </li>
<li> <a href = "javascript:" onclick = "Change_bg (this)"> menu2 </a> </li>
<li> <a href = "javascript:" onclick = "Change_bg (this)"> menu3 </a> </li>
<li> <a href = "javascript:" onclick = "Change_bg (this)"> menu4 </a> </li>
<li> <a href = "javascript:" onclick = "Change_bg (this)"> menu5 </a> </li>
</ul>
</div>
</docy>
</html>