js中onchange事件不起作用
<script>functionrefreshVcode(){document.getElementById("vcode").src="images/vcode.jpg...
<script>
function refreshVcode(){
document.getElementById("vcode").src="images/vcode.jpg?r="+Math.random();
}
function pwd(){
alert("你好");
var pwd = document.getElementById("pwd").value;
var repwd = document.getElementById("repwd").value;
if(pwd!=repwd){
document.getElementById("re").innerHTML="两次填写的密码不一致,请重新填写";
document.getElementById("repwd").value="";
}
document.getElementById("re").innerHTML="";
}
</script>
</head>
<body>
<div id="wrap">
<jsp:include page="inc/title.jsp" />
<div id="topic">
<div id="tlabel" > <a href="login.jsp">登录</a></div>
</div>
<form action="regist" method="post" >
<jsp:include page="inc/shang.jsp" />
<div class="field">
<div class="label">确认密码:</div>
<div class="editor">
<input type="password" name="repwd" class="txt" id="repwd" onkeyup="pwd()"/>
</div>
</div>
<div class="err" id="re"></div>
<div class="field">
<div class="label">Email:</div>
<div class="editor">
<input type="text" name="emil" class="txt"/>
</div>
</div>
<div class="err"></div>
<jsp:include page="inc/xia.jsp" />
</form>
</div>
</body>
</html> 展开
function refreshVcode(){
document.getElementById("vcode").src="images/vcode.jpg?r="+Math.random();
}
function pwd(){
alert("你好");
var pwd = document.getElementById("pwd").value;
var repwd = document.getElementById("repwd").value;
if(pwd!=repwd){
document.getElementById("re").innerHTML="两次填写的密码不一致,请重新填写";
document.getElementById("repwd").value="";
}
document.getElementById("re").innerHTML="";
}
</script>
</head>
<body>
<div id="wrap">
<jsp:include page="inc/title.jsp" />
<div id="topic">
<div id="tlabel" > <a href="login.jsp">登录</a></div>
</div>
<form action="regist" method="post" >
<jsp:include page="inc/shang.jsp" />
<div class="field">
<div class="label">确认密码:</div>
<div class="editor">
<input type="password" name="repwd" class="txt" id="repwd" onkeyup="pwd()"/>
</div>
</div>
<div class="err" id="re"></div>
<div class="field">
<div class="label">Email:</div>
<div class="editor">
<input type="text" name="emil" class="txt"/>
</div>
</div>
<div class="err"></div>
<jsp:include page="inc/xia.jsp" />
</form>
</div>
</body>
</html> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询