<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'JQueryStock.jsp' starting page</title>
<link type="text/css" rel="stylesheet" href="css/stock.css">
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.10.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
//获取焦点
$("#username").focus(function() {
var curValue = $(this).val();
if(curValue==this.defaultValue) {
$(this).val("");
}
});
//失去焦点
$("#username").blur(function() {
var curValue = $(this).val();
if($.trim(curValue)=="") {
$(this).val(this.defaultValue);
}
});
});
</script>
</head>
<body>
用户名<input type="text" name="username" id="username" value="邮箱/手机号/用户名"/><br/>
密码<input type="password" name="password" id="password"/><br/>
</body>
</html>
js登录小特效
最新推荐文章于 2023-12-08 18:00:00 发布