【发布时间】:2011-07-30 13:04:32
【问题描述】:
我使用 onblur 和 onfocus 在我的表单上创建了效果。如何更改这些 onblur 和 onfocus 元素的颜色?但是,我想将用户的输入默认设置为黑色。
$('input:text').focus(function(){
var newValue = $(this).val();
if($(this).val() == 'Email'){
$(this).attr('value','');
} else {
$(this).val(newValue);
}
});
$('input:text').blur(function(){
var newValue = $(this).val();
if($(this).val() == ''){
$(this).attr('value','Email');
} else {
$(this).val(newValue);
}
});
谢谢
【问题讨论】:
标签: html css forms fonts colors