$(".box_yazi2").each(function() {
var default_value = this.value;
$(this).css('color', '#555'); // this could be in the style sheet instead
$(this).focus(function() {
if (this.value == default_value) {
this.value = '';
$(this).css('color', '#000');
}
});
$(this).blur(function() {
if (this.value == '') {
$(this).css('color', '#555');
this.value = default_value;
}
});
});
Diese Funktion Standardwert Eingang funktioniert nicht in FF, aber funktioniert perfekt in IE und natürlich der Eingang selbst sieht wie folgt aus:Standardwert eines Eingangs Get jQuery
<input type="text" class="box_yazi2" id="konu" name="konu" value="Boş" />
Warum verwenden Sie 'this.defaultValue' nicht? – jensgram
Die letzte Zeile ist eine zusätzliche Menge von '});'. Wird das nur falsch kopiert? –
ich weiß nicht, wird es helfen? –