Text field actions

hi, i have a INPUT TEXT FIELD inside it describes what user must input there, (e.g. in the text field where user enters name says “<name>”, i want that when user clicks the field all the “<name>” words get selected so that when user writes the word gets erased, and that if user leaves the field in blank the word “<name>” returns, anyone knows how to do it?? tnks…