javascript - Clear TEXTAREA value after click (onFocus) -


i'm using..

onfocus="this.value=''; return false;" 

to clear value within textarea leaving comments. however, when click enter comment , type few things, if click outside box maybe read else on page , return comment clicking within textarea box again, clears current input.

is there anyway clear textarea on initial click clear default value , not rest of clicks rest of browser page's session?

it's better put instructions label tag, position on textarea, , hide or show if textarea focused. reason because textearea populated instructions , these might sent if inside form.

but, solve problem, have is:

onfocus="if(this.value== "your initial text"){this.value=''}; return false;" 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -