如下所示:
复制代码代码如下:
<! 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>
<style type = "text/css">
.ClearFieldBlurred {
สี: #CCC;
แบบฟอนต์: ตัวเอียง;
Font-Weight: ปกติ;
ความกว้าง: 150px;
-
.ClearFieldactive {
สี:#4E4E4E;
Font-Weight: ตัวหนา;
ความกว้าง: 150px;
-
</style>
<script type = "text/javascript">
ฟังก์ชั่น 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 = 'ClearfieldBlurred';
-
-
</script>
</head>
<body>
<อินพุต type = "text" id = "aaa" value = "aaa" onfocus = "ถ้า (this.value == 'aaa') {this.value = '' this.classname = 'clearfieldactive';} = "ถ้า (this.value == '') {this.value = 'aaa'; this.className = 'ClearfieldBlurred';}"/>>
<br />
<อินพุต type = "text" id = "bbb" value = "bbb" onclick = "clearfiled ()" />
</body>
</html>