Visa ett inlägg
Oläst 2010-03-01, 17:46 #5
ChristofferP ChristofferP är inte uppkopplad
Nykomling
 
Reg.datum: Oct 2008
Inlägg: 34
ChristofferP ChristofferP är inte uppkopplad
Nykomling
 
Reg.datum: Oct 2008
Inlägg: 34
Jag brukar använda följande kod med jQuery:

Kod:
$('input.field').focus(function() {
   if (this.value == this.defaultValue) { this.value = ''; }
}).blur(function() {
   if (this.value == '') { this.value = this.defaultValue; }
});
Kod:
<input class="field" type="text" value="Ange din e-postadress" />
ChristofferP är inte uppkopplad   Svara med citatSvara med citat