Testo “simpatico” in un campo form

Come si imposta un campo testo di un modulo HTML affinché abbia al suo interno un testo preimpostato che scompare nel momento in cui l’utente ci clicca dentro per scriverci?
…e soprattutto, come fare affinché non scompaia – al secondo click – anche il testo che ha scritto l’utente??

Così:


< input type="text" name="n" value="Your message" onFocus="if (this.value==this.defaultValue) this.value='' " onBlur="if (this.value=='') this.value=this.defaultValue" >

Lascia un commento

Il tuo indirizzo email non sarĂ  pubblicato.

You can add images to your comment by clicking here.