Change Text color Onfocus Event OR when user types something
<p>I am having Form in which txt box already has some value which changes when some user clicks in inside the txt box.The Font color is slightly set to a light color. So when a user types something the Font Color Should change to a dark color and should remain dark. Is there any java script to do this. </p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;style type="text/css"&gt;
.formWrapper input[type="text"]{float:left; width:178px; height:28px; line-height:27px; padding-left:5px; color:#CACACA; font-size:13px; font-weight:bold;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class="formWrapper"&gt;
&lt;form name=form&gt;
&lt;Input type="text" name="name1"  value="Eg : Flat-27,Block 4,Skyline" onfocus="if(this.value==this.defaultValue) this.value='';" onblur="if(this.value=='') this.value=this.defaultValue;" size="30"&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;/body&gt;  
</code></pre>
