How to make default text disappear from inside a textarea?

Sometimes I come to a website that has default text inside a field, as a way to prompt the user what they need to enter. How do I add this to a textarea tag? So that when they click in the textarea, the default text goes away and they can then type their own message.


It’s javascript. Generally you’d initialise the textarea with a value and a class that greys the text out a little. Then you’d detect the focus event, remove the class and set the value of the field to be an empty string “”. JQuery is your friend for this type of thing.