Delete default input value on click

I hate this task: „Delete default value of an input text on click„. Many times i use code like this

<input type="text" value="" name="email"
onblur="if (this.value == '') {this.value = '';}"
onfocus="if (this.value == '') {this.value = '';}" />

Forget about this! I would recommend you try HTML5 solution below which uses the placeholder attribut.

<input name="Email" type="text" value="" placeholder="" />

Vienas atsakymas į “Delete default input value on click”

Parašykite komentarą

El. pašto adresas nebus skelbiamas. Būtini laukeliai pažymėti *