Durch Ändern des Anzeigstils der Schaltfläche wird das Wischen des dynamischen Tastens erreicht
Die Codekopie lautet wie folgt:
<! 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> bis zum Titel "Dokument" </title>
</head>
<Styles>
.Search {Hintergrund:#008800; Farbe: #fff; Grenze: Keine; Höhe: 26px; Zeilenhöhe: 20px; Breite: 63x;}
.Searchhover {Hintergrund:#000099; Farbe: #fff; Grenze: Keine; Höhe: 26px; Zeilenhöhe: 20px; Breite: 63px; }
</style>
</head>
<Body Onload = "JS ()">
<Eingabe type = "button" id = "btn" name = "btn" value = "login"/>
<Eingabe type = "button" id = "btn2" name = "btn" value = "logout"/>
<script type = "text/javaScript">
Funktion JS ()
{
// Machen Sie IE6 Button Support HOVER -Attribut OBJ, das Entität, das HOVER unterstützen möchte
obj = "btn";
Alert (Navigator.Appname);
if (navigator.appname == "Microsoft Internet Explorer" && Parsefloat (navigator.appversion) == 4) {// urteilen IE6
var o = document.getElementsByName (obj);
für (var i = 0; i <o.Length; i ++) {
if (o [i] .Type == "Button") {
//o=
o [i] .onmouseover = function () {this.className = "SearchHover"}
o [i] .onmouseout = function () {this.className = "such"};
}
}
}
}
</script>
</body>
</html>