12 lines
No EOL
427 B
JavaScript
12 lines
No EOL
427 B
JavaScript
const password = document.getElementById("password");
|
|
const confirm_password = document.getElementById("confirmPassword");
|
|
function validatePassword(){
|
|
if(password.value != confirm_password.value) {
|
|
confirm_password.setCustomValidity("Passwords Don't Match");
|
|
}
|
|
else {
|
|
confirm_password.setCustomValidity('');
|
|
}
|
|
}
|
|
password.onchange = validatePassword;
|
|
confirm_password.onkeyup = validatePassword; |