input default value Jquery
- by venom
$(".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;
}
});
});
});
This function of default value of input doesnt work in FF, but perfectly works in IE
and ofcourse the input itself looks like this:
<input type="text" class="box_yazi2" id="konu" name="konu" value="Bos" />