javascript - clear text onclick - textfield -


What's the best way to clear text in the text field, when the user clicks on it?

If the text search field says "search" and when they click it, it clears the value.

You can do this:

  & lt; (This.value = ''} "onblur =" if (this.value == '') {this.value = 'search' } "& Gt;  

Comments