Created
August 15, 2021 06:01
-
-
Save aimahdi/f716baa2bd1ea8b88715272ecf1a422a to your computer and use it in GitHub Desktop.
The code will make second passwords field's text red until the password matched
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Change id with your password field's id | |
let passwordOne = document.getElementById("ff_143_password"); | |
let passwordTwo = document.getElementById("ff_143_password_again"); | |
passwordTwo.addEventListener('keyup', function(){ | |
let passwordTwo = document.getElementById("ff_143_password_again"); | |
console.log(passwordTwo.value); | |
//code here | |
if(passwordTwo.value==passwordOne.value){ | |
passwordTwo.style.color = 'blue'; | |
}else{ | |
passwordTwo.style.color = 'red'; | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment