如下所示 :
复制代码代码如下::
<! 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>
<style type = "text/css">
.Clearfieldblurred {
Farbe: #CCC;
Schriftstil: kursiv;
Schriftgewicht: normal;
Breite: 150px;
}
.Clearfieldactive {
Farbe:#4e4e4e;
Schriftgewicht: fett;
Breite: 150px;
}
</style>
<script type = "text/javaScript">
Funktion clearfiled () {
var bbb = document.getElementById ("BBB");
if (bbb.value == "bbb") {
BBB.Value = '';
BBB.CLASSNAME = 'ClearFieldActive';
}
}
window.document.onmouseDown = function () {
var bbb = document.getElementById ('BBB');
if (bbb.value == "") {
BBB.Value = 'BBB';
BBB.CLASSNAME = 'CLEARFIEFFBLURRED';
}
}
</script>
</head>
<body>
<Eingabe type = "text" id = "aaa" value = "aaa" onfocus = "if (this.value == 'aaa') {this.value = ''; = "if (this.value == '') {this.Value = 'aaa';
<br />
<Eingabe type = "text" id = "bbb" value = "bbb" onclick = "clearfiled ()" />
</body>
</html>