# On click inside text field erase its name

**URL:** <https://forum.kirupa.com/t/on-click-inside-text-field-erase-its-name/281836>\
**Category:** Uncategorized\
**Created:** [February 13, 2009, 5:58pm UTC](https://forum.kirupa.com/t/on-click-inside-text-field-erase-its-name/281836 "2009-02-13T17:58:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruiganga](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ruiganga/32/3679_2.png) [@ruiganga](https://forum.kirupa.com/u/ruiganga)\
**Post date:** [February 13, 2009, 5:58pm UTC](https://forum.kirupa.com/t/on-click-inside-text-field-erase-its-name/281836/1 "2009-02-13T17:58:49Z")

</div>

Hi

I have a textfield, and I put the field legend inside it. I want the text “type your name” to be erase once user click inside the textfield. How can I do that? And the reverse, if the text was lived empty show again “type your name”?

Thanks
