//设置提示文字js
$(".input") //所有样式名中含有input的input
.each(function() {
var oldVal = $(this).val(); //默认的提示性文本
$(this).css({
"color": "#a6a6a6"
}) //灰色
.focus(function() {
if ($(this).val() != oldVal) {
$(this).css({
"color": "#000"
})
} else {
$(this).val("").css({
"color": "#a6a6a6"
})
}
})
.blur(function() {
if ($(this).val() == "") {
$(this).val(oldVal).css({
"color": "#a6a6a6"
})
}
})
.keydown(function() {
$(this).css({
"color": "#000"
})
})
})
//设置password框js
$('.topPw ').focus(function() {
$(this).css('display', 'none').siblings('.password').focus();
});
$('.password').blur(function() {
if ($(this).val() == '') {
$(this).siblings('.topPw ').css('display', 'block');
}
})