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.
<html>
<head>
<style type="text/css">
.formWrapper input[type="text"]{float:left; width:178px; height:28px; line-height:27px; padding-left:5px; color:#CACACA; font-size:13px; font-weight:bold;}
</style>
</head>
<body>
<div class="formWrapper">
<form name=form>
<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">
</form>
</div>
</body>
In my example:
code:
html:
Live demo