把submit改成button就好了,原因,submit会自动提交到action属性指定地址,没有action则提交到本网页,刷新一下。自定义监听函数的跳转无效。
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>设置新密码</title>
</head>
<body>
<div>
<form method="post">
<div style="margin:5px 10px 20px 30px;font:bold 20px 宋体;">验证码<input style="margin:5px 10px 20px 30px;font:bold 20px 宋体;"class="verify" type="text" placeholder="验证码"/></div>
<div style="margin:5px 10px 20px 30px;font:bold 20px 宋体;">新密码<input style="margin:5px 10px 20px 30px;font:bold 20px 宋体;"class="newPass" type="password" placeholder="新密码"/></div>
<input style="margin:5px 10px 20px 30px;font:bold 20px 宋体;" id ="setNewPass" type="submit" value="提交">
</form>
</div>
<script src="../js/jquery.js"></script>
<script>
//$("#setNewPass").click(submitF);
function submitF(){
window.top.location='../t.htm';
}
</script>
</body>
</html>