As follows:
Copy codeThe Code is as follows:
<! 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> untitled document </title>
<Style type = "text/css">
. ClearFieldBlurred {
Color: # ccc;
Font-style: italic;
Font-weight: normal;
Width: 150px;
}
. ClearFieldActive {
Color: # 4e4e4e;
Font-weight: bold;
Width: 150px;
}
</Style>
<Script type = "text/javascript">
Function clearFiled (){
Var bbb = document. getElementById ("bbb ");
If (bbb. value = "bbb "){
Bbb. value = '';
Bbb. className = 'clearfieldactive ';
}
}
Required parameter Doc ument. onmousedown = function (){
Var bbb = document. getElementById ('bbb ');
If (bbb. value = ""){
Bbb. value = 'bbb ';
Bbb. className = 'clearfieldblurred ';
}
}
</Script>
</Head>
<Body>
<Input type = "text" id = "aaa" value = "aaa" class = "clearFieldBlurred" onfocus = "if (this. value = 'aaa') {this. value = ''; this. className = 'clearfieldactive';} "onblur =" if (this. value = '') {this. value = 'aaa'; this. className = 'clearfieldblurred';} "/>
<Br/>
<Input type = "text" id = "bbb" value = "bbb" class = "clearFieldBlurred" onclick = "clearFiled ()"/>
</Body>
</Html>