为什么不显示啊?
<script language="javaScript">
function pass() {
old_pass = document.getElementById("old_pass").value;
new_pass = document.getElementById("new_pass").value;
new_pass2 = document.getElementById("new_pass2").value;
if (old_pass == "") {
msg = "旧密码不得为空!";
var ch = document.getElementById("old_pass");
} else if (new_pass == "") {
msg = "新密码不得为空!";
var ch = document.getElementById("new_pass");
} else if (new_pass.length < 6) {
msg = "新密码不能小于6个字符,请重新输入!";
var ch = document.getElementById("new_pass");
} else if (new_pass != new_pass2) {
msg = "2次密码输入不一致!";
var ch = document.getElementById("new_pass2");
}
ch.innerHTML = msg;
return false;
}
</script>
<table width="99%" border="0" cellpadding="0" cellspacing="1">
<tr>
<td width="30%" height="30" bgcolor="#FFFFFF">
<div align="right" class="STYLE2 STYLE1">
请输入旧密码:
</div>
</td>
<td width="30%" bgcolor="#FFFFFF">
<input name="old_pass" type="password" id="old_pass" size="20" onBlur="return pass();"
/>
<span id="old_pass">
</span>
</td>
<td width="39%" bgcolor="#FFFFFF">
</td>
</tr>
<tr>
<td width="30%" height="30" bgcolor="#FFFFFF">
<div align="right" class="STYLE2 STYLE1">
请输入新密码:
</div>
</td>
<td width="30%" bgcolor="#FFFFFF">
<input name="new_pass" type="password" id="new_pass" size="20" onBlur="return pass();"
/>
<span id="new_pass">
</span>
</td>
<td width="39%" bgcolor="#FFFFFF">
</td>
</tr>
<tr>
<td width="30%" height="30" bgcolor="#FFFFFF" bgcolo r="#FFFFFF">
<div align="right" class="STYLE2 STYLE1">
请再次输入新密码:
</div>
</td>
<td width="30%" bgcolor="#FFFFFF">
<input name="new_pass2" type="password" id="new_pass2" size="20" onBlur="return pass();"
/>
<span id="new_pass2">
</span>
</td>
<td width="39%" bgcolor="#FFFFFF">
</td>
</tr>
</table>
------解决方案--------------------<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0