Styling text value of textbox

i have a few textboxes that are prepopulated using the text value to show ‘First name’ , ‘Surname’ etc and are removed on focus by the user.

Can these be styled as currently they appear black but client wants them light grey, but i dont want the entered text to be affected just the initial displayed text.

hows this done?

Please see following code, hope it will help you:

.init_text { color: lightgrey; }
.init_text:focus { color: black; }
<input class="init_text" type="text" value="Initial text" onchange="this.className = this.className.replace('init_text', 'entered_text');" />


for some reason im not seeing any effect on the initial text, its still black