<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>focus和blur</title>
<script src="js/jquery.js"></script>
</head>
<body>
<input type="text" id="address"value="请输入邮箱地址" />
<input type="text" id="password"value="请输入邮箱密码" />
<input type="button" value="登录" />
<script>
$("#address").focus(function(){
var text_value = $(this).val();
if(text_value=="请输入邮箱地址"){
$(this).val("");
}
});
$("#address").blur(function(){
$(this).val("请输入邮箱地址");
});
</script>
</body>
</html>