Author: aolinks
<! 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>
</Head>
<Style type = "text/css">
. Class {color: # ccc ;}
. Class_1 {color: #000 ;}
</Style>
<Script language = "javascript">
Function $ (obj)
{
Return document. getElementById (obj );
}
Var str_Tag = "Let's write two sentences here ";
Function on ()
{
If ($ ('ly '). value = ''| $ ('ly'). value = str_Tag)
{
$ ('Ly '). innerText = "";
$ ('Ly '). className = "class ";
}
}
Function off ()
{
If ($ ('ly '). value = '')
{
$ ('Ly '). innerText = str_Tag;
$ ('Ly '). className = "class ";
}
Else
$ ('Ly '). className = "class_1 ";
}
</Script>
<Body>
<Textarea name = "ly" id = "ly" cols = "" rows = "" onfocus = "on ();" onchange = "off (); "class =" class "> here are two sentences </textarea>
<Input id = "txtpws" type = "text" class = "class" onfocus = "if (this. value = 'Here are two sentences') {this. value = ''; this. className = 'class'} "onblur =" if (! This. value) {this. value = 'write two sentences here '; this. className = 'class';} "onkeydown =" this. className = 'class _ 1'; "value =" Let's write two sentences here. "style =" width: 200px; margin-top: 5px; "size =" 28 ">
</Body>
</Html>