Home >Web Front-end >HTML Tutorial >When the passwords entered twice are inconsistent, why does the pop-up popup shows that the passwords entered twice are consistent_html/css_WEB-ITnose

When the passwords entered twice are inconsistent, why does the pop-up popup shows that the passwords entered twice are consistent_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:49:334949browse





Untitled Document




New Password:


Confirm Password:







Reply to discussion (solution)

function checkPasswords() {
var pass1 = document.getElementsByName("password1")[0];
var pass2 =document.getElementsByName("password2")[0];
if (pass1.value!=pass2.value)
{
alert("The passwords entered twice are inconsistent");
}
else
{
alert("The passwords entered twice are consistent");
}
}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn