nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
回复讨论(解决方案)
function checkPasswords() {
var pass1 = document.getElementsByName("password1")[0];
var pass2 =document.getElementsByName("password2")[0];
if (pass1.value!=pass2.value)
{
alert("两次输入的密码不一致");
}
else
{
alert("两次输入的密码一致");
}
}