Placeholder is a project mainly written in JavaScript, it's free.
Mootools crossbrowser placeholder
cross browser placeholder.
Include the script and add a class "placeholder" to any form control you wish to add the functionality
create a placeholder for the element
<input type="text" class="placeholder" value="Name"/>
<input type="password" class="placeholder" value="Password"/>
<textarea class="placeholder">Your message...</textarea>
you can also add the functionality manually by calling the method autoempty on an element like this. you can pass the text to use as placeholder to autoempty, if you do not specify a text, the default value is used.
var control = $(form.control);
//the default value will be used as the placeholder with a custom color
control.autoempty({color: '#0E8F94'});
//change the placeholder text to 'Please type your name'
control.autoempty('Please type your name');